Skip to content

Instantly share code, notes, and snippets.

@pavolloffay
Last active January 19, 2016 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavolloffay/5c0a7aea318818f59293 to your computer and use it in GitHub Desktop.
Save pavolloffay/5c0a7aea318818f59293 to your computer and use it in GitHub Desktop.
Hawkular Data Mining demo
Helper functions for extracting Tenant and Feed id and their canonical paths.
feedId() {
curl -s GET 'http://jdoe:password@localhost:8080/hawkular/inventory/feeds'| grep --color=never -oP 'id" : "\K[\w-]+'
}
tenantId() {
curl -s GET 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant'| grep --color=never -oP 'id" : "\K[\w-]+'
}
feed() {
curl -s GET 'http://jdoe:password@localhost:8080/hawkular/inventory/feeds'| grep --color=never -oP 'path" : "\K/t;[\w-]+/f;[\w-]+'
}
tenant() {
curl -s GET 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant'| grep --color=never -oP 'path" : "\K/t;[\w-]+'
}
Heap Used Metric
metric=`feed`'/m;MI~R~%5B'`feedId`'%2FLocal~~%5D~MT~WildFly%20Memory%20Metrics~Heap%20Used'
metricId='MI~R~%5B'`feedId`'%2FLocal~~%5D~MT~WildFly%20Memory%20Metrics~Heap%20Used'
tenant=$(curl -s GET 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant'| grep --color=never -oP 'path" : "\K/t;[\w-]+')
Metrics - Heap Used
curl -s GET -H 'Hawkular-Tenant: '`tenantId` 'http://localhost:8080/hawkular/metrics/gauges/'$metricId'/data?start=0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment