Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.