v1

latestOpenAPI 3.0.12026-07-17221165.2 KB
PMAPI HOST SERVICES

Creates a new derived metric

Create a new derived metric, as defined by the pmAddDerived(3) metric interface. Derived metrics are associated with the named context, or a new context is created and returned in the result.

$ curl -s http://localhost:44322/pmapi/derive?name=blkio.avgsz&expr=disk.all.blktotal/disk.all.total | pmjson

This interface is one of the few that allows a POST to be used in place of a GET. In this case the HTTP POST request body may be used to provide one or more derived metrics specifications (all at once, across multiple lines, as a convenience).

$ curl -s http://localhost:44322/pmapi/fetch?name=blkio.avgsz&samples=2 | pmjson

Reference: pmAddDerived(3)

get/pmapi/derive

Query parameters

exprstring

Derived metric expression

namestring

New derived metric name

hostspecstring

Host specification as described in PCPIntro(1)

contextnumber

Web context number (optional like hostspec)

polltimeoutnumber

Seconds of inactivity before closing context

clientstring

Request identifier sent back with response

Response

OK