Skip to content

Commit

Permalink
use new infra
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Gonzalez Labrador committed Jan 18, 2021
1 parent 20981e6 commit f4a2292
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/metrics/xcloud.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metrics_data_driver_type = "xcloud"
metrics_record_interval = 5000
xcloud_instance="http://localhost"
xcloud_interval=5
xcloud_catalog='https://sciencemesh-test.uni-muenster.de/api/mentix/?action=register'
xcloud_catalog='https://sciencemesh-test.uni-muenster.de/api/mentix/sites?action=register'

[http.services.prometheus]

13 changes: 10 additions & 3 deletions pkg/metrics/driver/xcloud/xcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ func (d *CloudDriver) refresh() error {
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)

if resp.StatusCode != http.StatusOK {
err := fmt.Errorf("xcloud: error registering site: status code(%d) body(%s)", resp.StatusCode, string(body))
log.Err(err).Msg("xcloud: error registering site")
return err
}


log.Info().Msgf("xcloud: site registered: %s", string(body))

return nil
Expand Down Expand Up @@ -216,9 +223,9 @@ type CloudData struct {

// CloudDataMetrics reprents the metrics gathered from the sciencemesh app
type CloudDataMetrics struct {
TotalUsers int64 `json:"total_users"`
TotalGroups int64 `json:"total_groups"`
TotalStorage int64 `json:"total_storage"`
TotalUsers int64 `json:"numusers"`
TotalGroups int64 `json:"numgroups"`
TotalStorage int64 `json:"numstorage"`
}

// CloudDataSettings represents the metrics gathered
Expand Down

0 comments on commit f4a2292

Please sign in to comment.