-
Notifications
You must be signed in to change notification settings - Fork 123
Conversation
'version': '0.1.0', | ||
'container_image': self.pool.container_config.image, | ||
'docker_version': self.spawner.docker_client._docker_client.version(), | ||
'docker_containers': self.spawner.docker_client._docker_client.containers() |
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.
This is going to be a long-blocking call that won't hold up well in quick calls for stats on e.g. try.jupyter.org. As much as I'd want to see it, this isn't practical in current Docker and Go versions.
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.
Ditto. I got too excited thinking about all the cool things I was gonna do with D3 and this to think about performance.
I'll take it out for now, but I'll give it more thought in a future iteration of the stats page perhaps?
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.
Yeah that's ok. It's only this call to the number of containers and likely only affects the larger deployments (>500 users/containers in the pool). This number is also likely to be redundant as the number of containers equals the capacity + is tmpnb containerized + is the proxy containerized + any another containers.
I'd keep the capacity and available metrics instead.
All in all, awesome! I'm looking forward to this. |
@@ -232,7 +233,7 @@ def main(): | |||
(r"/spawn/?(/user/\w+(?:/.*)?)?", SpawnHandler), | |||
(r"/api/spawn/", APISpawnHandler), | |||
(r"/(user/\w+)(?:/.*)?", LoadingHandler), | |||
(r"/stats", StatsHandler), |
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.
Now that I'm thinking about it, we should probably have both /stats and /api/stats use the APIStatsHandler while also changing the tmpnb redirector.
Then folks can do migrations (ourselves included). After the deployments we know about have migrated (if they want to), then we'll change /stats to the new page you're working on.
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.
The new human page can be at /statistics
or /info
rather than re-using the URL.
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.
I like that better! Then we can keep /stats
as a redirect and /api/stats
as the canonical. Thanks as always @minrk. We could use /status
as well for the user view.
Ditto — updates coming later tonight. I'll go ahead and include the visualizations on this PR as well. |
@@ -69,13 +69,14 @@ def get(self, path=None): | |||
self.render("loading.html", path=path) | |||
|
|||
|
|||
class StatsHandler(BaseHandler): | |||
class APIStatsHandler(BaseHandler): | |||
def get(self): |
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.
While you're at it, can you add self.set_header("Content-Type", 'application/json')
to the APIHandler?
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.
@rgbkrk — This is not 100% what I was aiming for, but I think this should be good enough for an initial stats page. In the future, I'd like to make the plot area-based to better show the proportionally between used and unused containers. Not sure if you want to merge this and make an initial release or have me modify the visuals on this PR. |
I'd like to see capacity in here too, but we can follow on.
Yeah, that would be nice. Still in a time series view, but area based (as a proportion of capacity). We can always merge this and follow on right after. This hits exactly what we need for the time being. |
Updates to JSON-based API for stats
Yep! A wise man once said "Let's merge and iterate" 😉 |
(on my 4 node system 😉) |
The more I thought about it, the more I realized that showing the volume relationship is a matter of using capacity and available containers, where the labels are adjusted... |
@rgbkrk — What do you mean by that? The way I imagined the final product looking was a stacked area chart (see awful drawing below). |
You and I are talking about the same thing, yours has the right terminology though. 😄 We definitely want a stacked area chart. What I'm trying to say is algebraic in manipulation. 😉 The area between available and capacity is the used curve. If we plot capacity and available, used is the space between. It's the labels that change (and axes). |
Yep yep yep. Opening up an issue for this. Thinking it might be in the |
I think I'll do this specific issue in two chunks. First will be purely the JSON API at
/api/stats
and second will be the visual page at/stats/
.Let me know how it looks.