|
|
@ -23,7 +23,7 @@ namespace Squidex.Infrastructure.UsageTracking |
|
|
this.usageTracker = usageTracker; |
|
|
this.usageTracker = usageTracker; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async Task<long> GetMonthCostsAsync(string key, DateTime date) |
|
|
public async Task<long> GetMonthCallsAsync(string key, DateTime date) |
|
|
{ |
|
|
{ |
|
|
var apiKey = GetKey(key); |
|
|
var apiKey = GetKey(key); |
|
|
|
|
|
|
|
|
@ -32,6 +32,15 @@ namespace Squidex.Infrastructure.UsageTracking |
|
|
return counters.GetInt64(CounterTotalCalls); |
|
|
return counters.GetInt64(CounterTotalCalls); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<long> GetMonthBytesAsync(string key, DateTime date) |
|
|
|
|
|
{ |
|
|
|
|
|
var apiKey = GetKey(key); |
|
|
|
|
|
|
|
|
|
|
|
var counters = await usageTracker.GetForMonthAsync(apiKey, date); |
|
|
|
|
|
|
|
|
|
|
|
return counters.GetInt64(CounterTotalBytes); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public Task TrackAsync(DateTime date, string key, string? category, double weight, long elapsedMs, long bytes) |
|
|
public Task TrackAsync(DateTime date, string key, string? category, double weight, long elapsedMs, long bytes) |
|
|
{ |
|
|
{ |
|
|
var apiKey = GetKey(key); |
|
|
var apiKey = GetKey(key); |
|
|
|