-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added screen that shows transaction graph per hour, day and month #92
Conversation
I'm positioning this as a cheap stand-alone solution. A different approach would be exporting it as metric to a hosted tool like Datadog. That would involve more setup and would not make it available for everyone. |
* | ||
*/ | ||
|
||
package data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intellectual exercise, but weren't there libraries we could simply drop in? (Prometheus-esque?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but your deployment will also require 2 additional containers (prometheus and grafana), this requires additional devops work and costs for hosting.
This app is currently only for the foundation to track production network health. This is the quick and dirty solution for visualising something.
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
store := data.NewStore() | ||
loadHistory(store, config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app has to be restarted to show new data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As shown in the PR description, wip: Then connect Nats
I think using something like Prometheus will support future use cases better, e.g. it allows you to add labels (which can be a TX type, for example). |
var transactions [3][]DataPoint | ||
|
||
for i, window := range s.slidingWindows { | ||
transactions[i] = window.dataPoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
access not protected by the window.mutex
, not sure if it matters here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, ran it with -race and it failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not protected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutex has been placed on Public methods. This does not totally block things for the store (same package), it's more a convention. Otherwise you get lock-spaghetti or window needs its own package (overkill)
There shouldn't be future use-cases.
|
Co-authored-by: Gerard Snaauw <[email protected]>
OK |
From the time.Truncate docs
not sure if it is worth the extra complexity, but this seems to be the way to truncate the 24h resolution the 30 day graph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't review custom sliding window.
var transactions [3][]DataPoint | ||
|
||
for i, window := range s.slidingWindows { | ||
transactions[i] = window.dataPoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not protected?
part of #36
this PR adds a page with three graphs showing transaction counts.
Next step is to show counts per type of transactions.
Then show a top 10 of DID controllers with the most transactions total.
Then connect Nats