Luminarys / synapse

Synapse BitTorrent Daemon
https://synapse-bt.org
ISC License
853 stars 48 forks source link

Make historical stats available over RPC #22

Open ddevault opened 7 years ago

ddevault commented 7 years ago
{
    "type": "GET_RESOURCE_HISTORY",
    "serial": ...,
    "from": "...",
    "until": "...",
    "granularity": "daily" | "hourly" | "minute" | "second"
}
{
    "type": "RESOURCE_HISTORY",
    "serial": ...,
    "samples": [
        { "time": "...", "granularity": "...", "sample": { ... } }
    ]
}

Only include a few relevant stats in each sample, i.e. upload/download but not path.

Have a configurable time for rolling up stats (averaging or summing them as appropriate) as they grow older than some age. Suggested defaults:

Luminarys commented 7 years ago

An "id" field will be needed(maybe ids?). Also, it probably wouldn't make sense to store history for anything but torrents and the server itself, unless you have other resources in mind.

ddevault commented 7 years ago

Why not store it for everything? I wouldn't mind seeing historical up/down to a specific peer, each instance of reaching out to a tracker and what peers we got or stats we reported, etc.

Luminarys commented 7 years ago

It might get expensive storing everything, but i guess that is up to the users to decide how much they want to store, seeing as its already in ram already.