Skip to content

Commit

Permalink
remove origin slice from grafana, since we have stats page
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity committed Sep 12, 2023
1 parent faffb7b commit 0261240
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion service/pool/Main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ shared (creator) actor class Self(opt_params : ?Types.InitParams) = this {
// Metrics
public query func http_request(req : Metrics.HttpRequest) : async Metrics.HttpResponse {
if (req.url == "/metrics") {
let body = Metrics.metrics(stats, statsByOrigin);
let body = Metrics.metrics(stats);
{
status_code = 200;
headers = [("Content-Type", "text/plain; version=0.0.4"), ("Content-Length", Nat.toText(body.size()))];
Expand Down
3 changes: 1 addition & 2 deletions service/pool/Metrics.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module {
body: Blob;
};
let encode_single_value = Logs.encode_single_value;
public func metrics(stats: Logs.Stats, origin: Logs.StatsByOrigin) : Blob {
public func metrics(stats: Logs.Stats) : Blob {
let now = Time.now() / 1_000_000;
var result = "";
result := result # encode_single_value("counter", "canister_count", stats.num_of_canisters, "Number of canisters deployed", now);
Expand All @@ -24,7 +24,6 @@ module {
result := result # encode_single_value("counter", "out_of_capacity", stats.error_out_of_capacity, "Number of out of capacity requests", now);
result := result # encode_single_value("counter", "total_wait_time", stats.error_total_wait_time, "Number of seconds waiting for out of capacity requests", now);
result := result # encode_single_value("counter", "mismatch", stats.error_mismatch, "Number of mismatch requests including wrong nounce and timestamp", now);
result := result # origin.metrics();
Text.encodeUtf8(result)
};
}

0 comments on commit 0261240

Please sign in to comment.