Skip to content

Commit c8e2f9c

Browse files
committed
update
1 parent 4a36c20 commit c8e2f9c

4 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/CoreBIM.OpenTSDB/Models/DataPoint.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
1-
using System.Runtime.Serialization;
2-
using System.Text;
1+
using Newtonsoft.Json;
32

43
namespace OpenTSDB.Core.Models
54
{
6-
7-
[DataContract]
85
public class DataPoint<T>
9-
{
6+
{
107
/// <summary>
118
/// The name of the metric you are storing
129
/// </summary>
1310
/// <example>sys.cpu.nice</example>
14-
[DataMember(Name = "metric")]
11+
[JsonProperty("metric")]
1512
public string Metric { get; set; }
1613

1714
/// <summary>
1815
/// A Unix epoch style timestamp in seconds or milliseconds. The timestamp must not contain non-numeric characters.
1916
/// </summary>
2017
/// <example>1365465600</example>
21-
[DataMember(Name = "timestamp")]
18+
[JsonProperty("timestamp")]
2219
public int Timestamp { get; set; }
2320

2421
/// <summary>
2522
/// The value to record for this data point. It may be quoted or not quoted and must conform to the OpenTSDB value rules:
2623
/// DataType:Integer, Float, String
2724
/// </summary>
2825
/// <example>42.5</example>
29-
[DataMember(Name = "value")]
26+
[JsonProperty( "value")]
3027
public T Value { get; set; }
3128

3229
/// <summary>
3330
/// A key/value metadata list.
3431
/// A map of tag name/tag value pairs. At least one pair must be supplied.
3532
/// </summary>
3633
/// <example>{"host":"web01"}</example>
37-
[DataMember(Name = "tags")]
34+
[JsonProperty( "tags")]
3835
public Tags Tags { get; set; } = Tags.Create();
3936
}
4037
}

src/CoreBIM.OpenTSDB/Models/Tags.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace OpenTSDB.Core.Models
44
{
5-
65
public class Tags : Dictionary<string, string>
76
{
87
const string _host = "host";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace OpenTSDB.Core
77
{
8-
public class ApiClient : IDisposable
8+
public class OpenTsdbClient : IDisposable
99
{
1010
private static FlurlClient _client;
1111
//Time out

src/OpenTSDBSample/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void Main(string[] args)
2828

2929
class Test
3030
{
31-
ApiClient apiClient = new ApiClient();
31+
OpenTsdbClient apiClient = new OpenTsdbClient();
3232
public async void Run()
3333
{
3434
var list = new List<DataPoint<float>>();

0 commit comments

Comments
 (0)