메트릭 API 레퍼런스
모든 메트릭 가져오기
엔드포인트:
GET /v1/:page_id/metrics?page=:page&per_page=:per_page
- 기본 page 번호는 1입니다.
- 기본 per_page 값은 50이며 페이지당 최대 100개입니다.
응답 예시:
[{"id": "ckj1qyonq9sdk09819xdg4ehm","name": "Testing","active": true,"order": 1,"suffix": "ms","data": [{"timestamp": 1608474985000,"value": 355},{"timestamp": 1608475225000,"value": 428.25},{"timestamp": 1608475465000,"value": 356},{"timestamp": 1608475705000,"value": 451.75},...]},...]
메트릭 가져오기
엔드포인트:
GET /v1/:page_id/metrics/:metric_id
응답 예시:
{"id": "ckj1qyonq9sdk09819xdg4ehm","name": "Testing","active": true,"order": 1,"suffix": "ms","data": [{"timestamp": 1608474985000,"value": 355},{"timestamp": 1608475225000,"value": 428.25},{"timestamp": 1608475465000,"value": 356},{"timestamp": 1608475705000,"value": 451.75},...]}
메트릭 추가하기
엔드포인트:
POST /v1/:page_id/metrics
{"subdomain": "nasa","name": "Response time","suffix": "ms"}
응답 예시:
{"id": "ckj1qyonq9sdk09819xdg4ehm","name": "Response time","active": true,"order": 1,"suffix": "ms","lastDataAt": 1608561235000,"data": [{"timestamp": 1608474985000,"value": 355},{"timestamp": 1608475225000,"value": 428.25},{"timestamp": 1608475465000,"value": 356},...]}
메트릭 업데이트하기
엔드포인트:
PUT /v1/:page_id/metrics/:metric_id
요청 예시:
{"name": "Response time","suffix": "ms"}
응답 예시:
{"id": "ckj1qyonq9sdk09819xdg4ehm","name": "Response time","active": true,"order": 1,"suffix": "ms","lastDataAt": 1608561235000,"data": [{"timestamp": 1608474985000,"value": 355},{"timestamp": 1608475225000,"value": 428.25},{"timestamp": 1608475465000,"value": 356},...]}
메트릭 삭제하기
엔드포인트:
DELETE /v1/:page_id/metrics/:metric_id
메트릭에 데이터 포인트 추가하기
엔드포인트:
POST /v1/:page_id/metrics/:metric_id
요청:
{"timestamp": 1608672985000,"value": 356}
응답:
{"id": "ckj395ptx9ha40995ckzv0pz2","value": 356,"timestamp": 1608672985000}
메트릭에 여러 데이터 포인트 추가하기
엔드포인트:
POST /v1/:page_id/metrics/:metric_id/data
요청:
{"data": [{"timestamp": 1608474985000,"value": 355},{"timestamp": 1608475225000,"value": 428.25},{"timestamp": 1608475465000,"value": 356},{"timestamp": 1608475705000,"value": 451.75},{"timestamp": 1608475945000,"value": 395},{"timestamp": 1608476185000,"value": 375.75},{"timestamp": 1608476425000,"value": 380.25},...]}
응답
[{"timestamp": 1608474985000,"value": 355},{"timestamp": 1608475225000,"value": 428.25},{"timestamp": 1608475465000,"value": 356},{"timestamp": 1608475705000,"value": 451.75},{"timestamp": 1608475945000,"value": 395},{"timestamp": 1608476185000,"value": 375.75},{"timestamp": 1608476425000,"value": 380.25}]
메트릭의 데이터 포인트 삭제하기
엔드포인트:
DELETE /v1/:page_id/metrics/:metric_id/data
응답
{"name": "Response time","site": {"id": "ckj1qyonq9sdk09819xdg4ehm","subdomain": "our"}}