-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
675 additions
and
677 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
|
||
namespace Client.Model | ||
{ | ||
|
||
/// <summary> | ||
/// Set of data to send for a bulk write. This encapsulates the timestamp and list of BulkPoints | ||
/// </summary> | ||
public class BulkDataSet | ||
{ | ||
/// <param name="timestamp"> The timestamp to write the datapoints at </param> | ||
/// <param name="data"> A list of BulkPoints to write </param> | ||
/// <summary> | ||
/// Set of data to send for a bulk write. This encapsulates the timestamp and list of BulkPoints | ||
/// </summary> | ||
public class BulkDataSet | ||
{ | ||
/// <param name="timestamp"> The timestamp to write the datapoints at </param> | ||
/// <param name="data"> A list of BulkPoints to write </param> | ||
|
||
public BulkDataSet(DateTime timestamp, List<BulkPoint> data) | ||
{ | ||
Timestamp = timestamp; | ||
Data = data; | ||
} | ||
public BulkDataSet(DateTime timestamp, List<BulkPoint> data) | ||
{ | ||
Timestamp = timestamp; | ||
Data = data; | ||
} | ||
|
||
[JsonProperty(PropertyName = "t")] | ||
public DateTime Timestamp { get; private set; } | ||
[JsonProperty(PropertyName = "t")] | ||
public DateTime Timestamp { get; private set; } | ||
|
||
[JsonProperty(PropertyName = "data")] | ||
public List<BulkPoint> Data { get; private set; } | ||
} | ||
} | ||
[JsonProperty(PropertyName = "data")] | ||
public List<BulkPoint> Data { get; private set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
using Newtonsoft.Json; | ||
|
||
|
||
namespace Client.Model | ||
{ | ||
/// <summary> | ||
/// Represents a datapoint for a series referenced by id. This class is used to represent | ||
/// datapoints in a bulk write. | ||
/// </summary> | ||
public class BulkIdPoint : BulkPoint | ||
{ | ||
/// <param name="id"> The id of the Series </param> | ||
/// <param name="value"> The datapoint value </param> | ||
public BulkIdPoint(string id, double value) | ||
{ | ||
Id = id; | ||
Value = value; | ||
} | ||
/// <summary> | ||
/// Represents a datapoint for a series referenced by id. This class is used to represent | ||
/// datapoints in a bulk write. | ||
/// </summary> | ||
public class BulkIdPoint : BulkPoint | ||
{ | ||
/// <param name="id"> The id of the Series </param> | ||
/// <param name="value"> The datapoint value </param> | ||
public BulkIdPoint(string id, double value) | ||
{ | ||
Id = id; | ||
Value = value; | ||
} | ||
|
||
[JsonProperty(PropertyName = "id")] | ||
public string Id { get; private set; } | ||
} | ||
[JsonProperty(PropertyName = "id")] | ||
public string Id { get; private set; } | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
using Newtonsoft.Json; | ||
|
||
|
||
namespace Client.Model | ||
{ | ||
/// <summary> | ||
/// Represents a datapoint for a series referenced by id. This class is used to represent | ||
/// datapoints in a bulk write. | ||
/// </summary> | ||
public class BulkKeyPoint : BulkPoint | ||
{ | ||
/// <param name="key"> The key of the Series </param> | ||
/// <param name="value"> The datapoint value </param> | ||
public BulkKeyPoint(string key, double value) | ||
{ | ||
Key = key; | ||
Value = value; | ||
} | ||
/// <summary> | ||
/// Represents a datapoint for a series referenced by id. This class is used to represent | ||
/// datapoints in a bulk write. | ||
/// </summary> | ||
public class BulkKeyPoint : BulkPoint | ||
{ | ||
/// <param name="key"> The key of the Series </param> | ||
/// <param name="value"> The datapoint value </param> | ||
public BulkKeyPoint(string key, double value) | ||
{ | ||
Key = key; | ||
Value = value; | ||
} | ||
|
||
[JsonProperty(PropertyName = "key")] | ||
public string Key { get; private set; } | ||
} | ||
[JsonProperty(PropertyName = "key")] | ||
public string Key { get; private set; } | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
|
||
using Newtonsoft.Json; | ||
|
||
|
||
namespace Client.Model | ||
{ | ||
/// <summary> | ||
/// The abstract parent class representing a datapoint used in a bulk write. Bulk | ||
/// writing allows values for different series to be written for the same timestamp in one | ||
/// Rest call. The series can be referenced by series id or series key. The two subclasses | ||
/// represent these two options. | ||
/// </summary> | ||
/// <summary> | ||
/// The abstract parent class representing a datapoint used in a bulk write. Bulk | ||
/// writing allows values for different series to be written for the same timestamp in one | ||
/// Rest call. The series can be referenced by series id or series key. The two subclasses | ||
/// represent these two options. | ||
/// </summary> | ||
|
||
public abstract class BulkPoint | ||
{ | ||
[JsonProperty(PropertyName = "v")] | ||
public double Value { get; set; } | ||
} | ||
} | ||
public abstract class BulkPoint | ||
{ | ||
[JsonProperty(PropertyName = "v")] | ||
public double Value { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
namespace Client.Model | ||
{ | ||
public static class FoldingFunction | ||
{ | ||
public static readonly string Count = "count"; | ||
public static readonly string Max = "max"; | ||
public static readonly string Mean = "mean"; | ||
public static readonly string Min = "min"; | ||
public static readonly string StandardDeviation = "stddev"; | ||
public static readonly string Sum = "sum"; | ||
public static readonly string SumOfSquares = "ss"; | ||
} | ||
|
||
public static class IntervalParameter | ||
{ | ||
public static string Days(int days) | ||
{ | ||
return string.Format("{0}day", days); | ||
} | ||
|
||
public static string Hours(int hours) | ||
{ | ||
return string.Format("{0}hour", hours); | ||
} | ||
|
||
public static string Minutes(int minutes) | ||
{ | ||
return string.Format("{0}min", minutes); | ||
} | ||
|
||
public static string Months(int months) | ||
{ | ||
return string.Format("{0}month", months); | ||
} | ||
|
||
public static string Years(int years) | ||
{ | ||
return string.Format("{0}year", years); | ||
} | ||
|
||
public static string Raw() | ||
{ | ||
return "raw"; | ||
} | ||
|
||
} | ||
|
||
public static class SeriesProperty | ||
{ | ||
public static readonly string Id = "id"; | ||
public static readonly string Key = "key"; | ||
} | ||
|
||
public static class QueryStringParameter | ||
{ | ||
public static readonly string Id = "id"; | ||
public static readonly string Key = "key"; | ||
public static readonly string Start = "start"; | ||
public static readonly string End = "end"; | ||
public static readonly string Function = "function"; | ||
public static readonly string Interval = "interval"; | ||
} | ||
} | ||
public static class FoldingFunction | ||
{ | ||
public static readonly string Count = "count"; | ||
public static readonly string Max = "max"; | ||
public static readonly string Mean = "mean"; | ||
public static readonly string Min = "min"; | ||
public static readonly string StandardDeviation = "stddev"; | ||
public static readonly string Sum = "sum"; | ||
public static readonly string SumOfSquares = "ss"; | ||
} | ||
|
||
public static class IntervalParameter | ||
{ | ||
public static string Days(int days) | ||
{ | ||
return string.Format("{0}day", days); | ||
} | ||
|
||
public static string Hours(int hours) | ||
{ | ||
return string.Format("{0}hour", hours); | ||
} | ||
|
||
public static string Minutes(int minutes) | ||
{ | ||
return string.Format("{0}min", minutes); | ||
} | ||
|
||
public static string Months(int months) | ||
{ | ||
return string.Format("{0}month", months); | ||
} | ||
|
||
public static string Years(int years) | ||
{ | ||
return string.Format("{0}year", years); | ||
} | ||
|
||
public static string Raw() | ||
{ | ||
return "raw"; | ||
} | ||
|
||
} | ||
|
||
public static class SeriesProperty | ||
{ | ||
public static readonly string Id = "id"; | ||
public static readonly string Key = "key"; | ||
} | ||
|
||
public static class QueryStringParameter | ||
{ | ||
public static readonly string Id = "id"; | ||
public static readonly string Key = "key"; | ||
public static readonly string Start = "start"; | ||
public static readonly string End = "end"; | ||
public static readonly string Function = "function"; | ||
public static readonly string Interval = "interval"; | ||
} | ||
} |
Oops, something went wrong.