This commit is contained in:
2020-05-29 16:21:24 +00:00
parent 45b26b7484
commit eb5192ae59

View File

@@ -21,8 +21,28 @@ namespace raven_integration
[Fact]
public async void MetricsShouldFetch()
{
DateTime tsStart = DateTime.Now.AddMinutes(-1).ToOffsetAdjustedUniversalTime();
DateTime tsEnd = DateTime.Now.AddHours(-6).ToOffsetAdjustedUniversalTime();
// DateTime tsEnd = DateTime.Now.ToOffsetAdjustedUniversalTime();//{2020-05-29 3:30:21 PM}
// DateTime tsStart = DateTime.Now.AddHours(-6).ToOffsetAdjustedUniversalTime();//{2020-05-29 9:30:21 AM}
// DateTime tsEnd = DateTime.UtcNow;//{2020-05-29 3:32:54 PM}
// DateTime tsStart = DateTime.UtcNow.AddHours(-6); //{2020-05-29 9:32:54 AM}
//weirdly, this is the only way to get the correct date range
//just as the html client does but from here
//in both cases the server shows parameters as local time to the server
//and in the route I have to adjust them back to universal time before sending them to the db query
//as the db data is in utc and the db server doesn't know what timezone it is
DateTime tsEnd = DateTime.Now;//{2020-05-29 8:36:48 AM}
DateTime tsStart = DateTime.Now.AddHours(-6); //{2020-05-29 2:36:48 AM}
//http://localhost:7575/api/v8.0/server-metric/mm?maxRecords=200&tsStart=2020-05-29T09:23:18.114Z&tsEnd=2020-05-29T15:23:19.114Z
//from client at server route {2020-05-29 2:29:25 AM} {2020-05-29 8:29:26 AM}
var wtf = $"server-metric/mm?tsStart={tsStart}&tsEnd={tsEnd}";
ApiResponse a = await Util.GetAsync($"server-metric/mm?tsStart={tsStart}&tsEnd={tsEnd}", await Util.GetTokenAsync("OpsAdminFull"));
Util.ValidateDataReturnResponseOk(a);