mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-10 15:57:53 +00:00
Add basic InfluxDB reporter
This commit is contained in:
parent
2d58705e85
commit
02b41413b3
7 changed files with 125 additions and 6 deletions
|
|
@ -72,6 +72,12 @@ namespace PluralKit {
|
|||
using (var conn = await _conn.Obtain())
|
||||
return await conn.QueryAsync<ulong>("select uid from accounts where system = @Id", new { Id = system.Id });
|
||||
}
|
||||
|
||||
public async Task<ulong> Count()
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
return await conn.ExecuteScalarAsync<ulong>("select count(id) from systems");
|
||||
}
|
||||
}
|
||||
|
||||
public class MemberStore {
|
||||
|
|
@ -138,6 +144,12 @@ namespace PluralKit {
|
|||
using (var conn = await _conn.Obtain())
|
||||
return await conn.ExecuteScalarAsync<int>("select count(*) from members where system = @Id", system);
|
||||
}
|
||||
|
||||
public async Task<ulong> Count()
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
return await conn.ExecuteScalarAsync<ulong>("select count(id) from members");
|
||||
}
|
||||
}
|
||||
|
||||
public class MessageStore {
|
||||
|
|
@ -185,6 +197,12 @@ namespace PluralKit {
|
|||
using (var conn = await _conn.Obtain())
|
||||
await conn.ExecuteAsync("delete from messages where mid = @Id", new { Id = id });
|
||||
}
|
||||
|
||||
public async Task<ulong> Count()
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
return await conn.ExecuteScalarAsync<ulong>("select count(mid) from messages");
|
||||
}
|
||||
}
|
||||
|
||||
public class SwitchStore
|
||||
|
|
@ -258,6 +276,12 @@ namespace PluralKit {
|
|||
await conn.ExecuteAsync("delete from switches where id = @Id", new {Id = sw.Id});
|
||||
}
|
||||
|
||||
public async Task<ulong> Count()
|
||||
{
|
||||
using (var conn = await _conn.Obtain())
|
||||
return await conn.ExecuteScalarAsync<ulong>("select count(id) from switches");
|
||||
}
|
||||
|
||||
public struct SwitchListEntry
|
||||
{
|
||||
public ICollection<PKMember> Members;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue