gtfierro / giles

Golang implementation of sMAP archiver
GNU General Public License v3.0
8 stars 2 forks source link

[WIP] Add stats web app #34

Open ahaas opened 9 years ago

ahaas commented 9 years ago

screen shot 2015-03-10 at 1 23 02 am

gtfierro commented 9 years ago

Good work! The page looks nice and clean. Two things:

  1. Could you add a second path that exposes all the same information but as JSON? Having an easily consumable endpoint is nice for development over an installation (or several installations).
  2. It's best not to commit the compiled binaries. Could you remove that from the PR?

After you make the above 2 changes, I can merge. Great job!

ahaas commented 9 years ago

In regards to (1), I think this already exists through the /api/systemstats route I added.

/api/systemstats returns a JSON object corresponding to the systemStats struct.

Currently index.js regularly queries the /api/systemstats endpoint to update the displayed info.

gtfierro commented 9 years ago

Ah, right you are. Sorry!

gtfierro commented 9 years ago

Finally got around to testing this. I get the following error when running:

1 gabe@pantry:~/src/giles/stats⟫ go run stats.go 
# command-line-arguments
./stats.go:83: cannot use bootTime (type uint64) as type int64 in argument to time.Unix

Also, this should really be folded into the main archiver service, rather than being a standalone program. Take a look at how I handle running multiple web servers in https://github.com/gtfierro/giles/blob/master/giles.go#L47-L65.

The port should also be configurable. You can handle this in https://github.com/gtfierro/giles/blob/master/archiver/config.go

gtfierro commented 9 years ago

How close is this to done? Are there outstanding commits, or should I test and merge?

ahaas commented 9 years ago

You can test and merge. By the way, I believe the old bug is now still present intermittently - #40