attributes.c
A list of examples for Doxygen to cross-reference. If a function in newrelic-telemetry-sdk.h appears in one of these examples, the example source file appears under the "Examples" header.
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "newrelic-telemetry-sdk.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
/*
* Create and destroy an attributes collection.
*/
int main() {
/* Destroy a NULL configuration. */
nrt_attributes_t* attrs = NULL;
nrt_attributes_destroy(&attrs);
/* Initialize and destroy attributes of all types. */
attrs = nrt_attributes_new();
assert(attrs);
nrt_attributes_destroy(&attrs);
assert(NULL == attrs);
/* Call with NULL values */
nrt_attributes_set_int(NULL, NULL, -6);
nrt_attributes_set_uint(NULL, NULL, 6);
nrt_attributes_set_double(NULL, NULL, 3.14159);
nrt_attributes_set_string(NULL, NULL, NULL);
nrt_attributes_set_bool(NULL, NULL, true);
nrt_attributes_destroy(NULL);
}
bool nrt_attributes_set_string(nrt_attributes_t *attributes, const char *key, const char *value)
Add a string attribute to an attribute collection.
bool nrt_attributes_set_int(nrt_attributes_t *attributes, const char *key, int64_t value)
Add an int attribute to an attribute collection.
This is a helper library that supports sending New Relic data from within your C/C++ application.
bool nrt_attributes_set_bool(nrt_attributes_t *attributes, const char *key, bool value)
Add a bool attribute to an attribute collection.
bool nrt_attributes_set_uint(nrt_attributes_t *attributes, const char *key, uint64_t value)
Add an unsigned int attribute to an attribute collection.
void nrt_attributes_destroy(nrt_attributes_t **attributes)
Destroy an attribute collection.
struct _nrt_attributes_t nrt_attributes_t
A collection of attributes.
Definition: newrelic-telemetry-sdk.h:60
bool nrt_attributes_set_double(nrt_attributes_t *attributes, const char *key, double value)
Add a double attribute to an attribute collection.
Generated on Wed Sep 16 2020 23:07:29 for New Relic C Telemetry SDK by
