|
| 1 | +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 | + |
| 3 | +/* CMetrics |
| 4 | + * ======== |
| 5 | + * Copyright 2024 The CMetrics Authors |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | + |
| 21 | +#ifndef CMT_ENCODE_CLOUDWATCH_EMF_PAYLOAD_H |
| 22 | +#define CMT_ENCODE_CLOUDWATCH_EMF_PAYLOAD_H |
| 23 | + |
| 24 | +#include <time.h> |
| 25 | +#include <cfl/cfl.h> |
| 26 | +#include <cmetrics/cmetrics.h> |
| 27 | + |
| 28 | +#define CMT_ENCODE_CLOUDWATCH_EMF_PAYLOAD_SUCCESS 0 |
| 29 | +#define CMT_ENCODE_CLOUDWATCH_EMF_PAYLOAD_INVALID_ARGUMENT_ERROR -1 |
| 30 | +#define CMT_ENCODE_CLOUDWATCH_EMF_PAYLOAD_CREATION_FAILED -2 |
| 31 | +#define CMT_ENCODE_CLOUDWATCH_EMF_PAYLOAD_INVALID_DATA_ERROR -4 |
| 32 | + |
| 33 | +/* Metric Unit */ |
| 34 | +#define CMT_EMF_UNIT_PERCENT "Percent" |
| 35 | +#define CMT_EMF_UNIT_BYTES "Bytes" |
| 36 | +#define CMT_EMF_UNIT_COUNTER "Counter" |
| 37 | + |
| 38 | +int cmt_encode_cloudwatch_emf_payload_create(struct cmt *cmt, |
| 39 | + char **out_buf, size_t *out_size, |
| 40 | + int wrap_array); |
| 41 | +void cmt_encode_cloudwatch_emf_payload_destroy(char *out_buf); |
| 42 | + |
| 43 | +#endif |
0 commit comments