Skip to content

Commit

Permalink
handle empty response (rfcpcount % batchsize == 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
zivillian committed Nov 18, 2018
1 parent 2e5f600 commit 38852de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ommstats/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,16 @@ private async Task AddRfpStatsAsync(Dictionary<string, double> target, Cancellat
{
var group = escaper.Escape(statName.Group);
var metric = escaper.Escape(statName.Name);
if (rfpStats.Data == null) continue;
foreach (var rfp in rfpStats.Data)
{
var value = rfp.Values[statName.Id];
target.Add($"omm.rfpstats.{group}.{metric}.{rfp.Id}", value);
}
}
id = rfpStats.Data.Max(x => x.Id) + 1;
} while (rfpStats.Data.Length == count);
if (rfpStats.Data != null)
id = rfpStats.Data.Max(x => x.Id) + 1;
} while (rfpStats.Data != null && rfpStats.Data.Length == count);
}

protected virtual void Dispose(bool disposing)
Expand Down

0 comments on commit 38852de

Please sign in to comment.