|
1 | | -using System.Runtime.Serialization; |
2 | | -using System.Text; |
| 1 | +using Newtonsoft.Json; |
3 | 2 |
|
4 | 3 | namespace OpenTSDB.Core.Models |
5 | 4 | { |
6 | | - |
7 | | - [DataContract] |
8 | 5 | public class DataPoint<T> |
9 | | - { |
| 6 | + { |
10 | 7 | /// <summary> |
11 | 8 | /// The name of the metric you are storing |
12 | 9 | /// </summary> |
13 | 10 | /// <example>sys.cpu.nice</example> |
14 | | - [DataMember(Name = "metric")] |
| 11 | + [JsonProperty("metric")] |
15 | 12 | public string Metric { get; set; } |
16 | 13 |
|
17 | 14 | /// <summary> |
18 | 15 | /// A Unix epoch style timestamp in seconds or milliseconds. The timestamp must not contain non-numeric characters. |
19 | 16 | /// </summary> |
20 | 17 | /// <example>1365465600</example> |
21 | | - [DataMember(Name = "timestamp")] |
| 18 | + [JsonProperty("timestamp")] |
22 | 19 | public int Timestamp { get; set; } |
23 | 20 |
|
24 | 21 | /// <summary> |
25 | 22 | /// The value to record for this data point. It may be quoted or not quoted and must conform to the OpenTSDB value rules: |
26 | 23 | /// DataType:Integer, Float, String |
27 | 24 | /// </summary> |
28 | 25 | /// <example>42.5</example> |
29 | | - [DataMember(Name = "value")] |
| 26 | + [JsonProperty( "value")] |
30 | 27 | public T Value { get; set; } |
31 | 28 |
|
32 | 29 | /// <summary> |
33 | 30 | /// A key/value metadata list. |
34 | 31 | /// A map of tag name/tag value pairs. At least one pair must be supplied. |
35 | 32 | /// </summary> |
36 | 33 | /// <example>{"host":"web01"}</example> |
37 | | - [DataMember(Name = "tags")] |
| 34 | + [JsonProperty( "tags")] |
38 | 35 | public Tags Tags { get; set; } = Tags.Create(); |
39 | 36 | } |
40 | 37 | } |
|
0 commit comments