|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
| 15 | +using System; |
15 | 16 | using System.Collections.Generic; |
16 | 17 | using System.Threading; |
17 | 18 | using System.Threading.Tasks; |
18 | 19 | using Seq.Api.Model.Diagnostics; |
| 20 | +using Seq.Api.Model.Diagnostics.Storage; |
19 | 21 | using Seq.Api.Model.Inputs; |
20 | 22 |
|
| 23 | +// ReSharper disable UnusedMember.Global |
| 24 | + |
21 | 25 | namespace Seq.Api.ResourceGroups |
22 | 26 | { |
23 | 27 | /// <summary> |
@@ -65,11 +69,38 @@ public async Task<string> GetIngestionLogAsync(CancellationToken cancellationTok |
65 | 69 | /// </summary> |
66 | 70 | /// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param> |
67 | 71 | /// <param name="measurement">The measurement to get.</param> |
68 | | - /// <returns></returns> |
| 72 | + /// <returns>A timeseries showing the measurement over time.</returns> |
69 | 73 | public async Task<MeasurementTimeseriesPart> GetMeasurementTimeseriesAsync(string measurement, CancellationToken cancellationToken = default) |
70 | 74 | { |
71 | 75 | var parameters = new Dictionary<string, object>{ ["measurement"] = measurement }; |
72 | 76 | return await GroupGetAsync<MeasurementTimeseriesPart>("Metric", parameters, cancellationToken); |
73 | 77 | } |
| 78 | + |
| 79 | + /// <summary> |
| 80 | + /// Report on storage space consumed by the event store across a range of timestamps. The returned range may be |
| 81 | + /// extended to account for the resolution of the underlying data. |
| 82 | + /// </summary> |
| 83 | + /// <param name="rangeStart">The (inclusive) start of the range to report on. If omitted, the results will report from the |
| 84 | + /// earliest stored data. The range start must land on a five-minute boundary.</param> |
| 85 | + /// <param name="rangeEnd">The (exclusive) end of the range to report on. If omitted, the results will report from the |
| 86 | + /// earliest stored data. The range must be a multiple of the interval size, or a whole number of days if |
| 87 | + /// no interval is specified.</param> |
| 88 | + /// <param name="intervalMinutes">The bucket size to use. Must be a multiple of 5 minutes. Defaults to 1440 (one day).</param> |
| 89 | + /// <param name="cancellationToken">A <see cref="CancellationToken"/> allowing the operation to be canceled.</param> |
| 90 | + /// <returns>Storage consumption information.</returns> |
| 91 | + public async Task<StorageConsumptionPart> GetStorageConsumptionAsync( |
| 92 | + DateTime? rangeStart, |
| 93 | + DateTime? rangeEnd, |
| 94 | + int? intervalMinutes, |
| 95 | + CancellationToken cancellationToken = default) |
| 96 | + { |
| 97 | + var parameters = new Dictionary<string, object> |
| 98 | + { |
| 99 | + ["rangeStart"] = rangeStart, |
| 100 | + ["rangeEnd"] = rangeEnd, |
| 101 | + ["intervalMinutes"] = intervalMinutes |
| 102 | + }; |
| 103 | + return await GroupGetAsync<StorageConsumptionPart>("Storage", parameters, cancellationToken); |
| 104 | + } |
74 | 105 | } |
75 | 106 | } |
0 commit comments