paged single metrics

This commit is contained in:
boufni95 2025-01-17 18:43:27 +00:00
parent db3c27c7f2
commit eadc956c4c
12 changed files with 213 additions and 91 deletions

View file

@ -172,12 +172,18 @@ service LightningPub {
option (nostr) = true;
}
rpc GetUsageMetrics(structs.UsageMetricReq) returns (structs.UsageMetrics) {
rpc GetUsageMetrics(structs.LatestUsageMetricReq) returns (structs.UsageMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/usage";
option (nostr) = true;
}
rpc GetSingleUsageMetrics(structs.SingleUsageMetricReq) returns (structs.UsageMetricTlv) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/usage/single";
option (nostr) = true;
}
rpc GetErrorStats(structs.Empty) returns (structs.ErrorStats) {
option (auth_type) = "Metrics";
option (http_method) = "post";

View file

@ -34,16 +34,19 @@ message ErrorStats {
}
message MetricsFile {
}
message LatestUsageMetricReq {
optional int64 limit = 1;
}
message SingleUsageMetricReq {
string app_id = 1;
string metrics_name = 2;
int64 page = 3;
}
message UsageMetricReq {
optional int64 limit = 1;
optional MetricsFile metrics_file = 2;
}
message UsageMetric {
int64 processed_at_ms = 1;
int64 parsed_in_nano = 2;