AT&T ECOMP Vendor Event Listener library  0.1
Functions
evel_reporting_measurement.c File Reference

Implementation of EVEL functions relating to the Measurement for VF Reporting event. More...

#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include "evel.h"
#include "evel_internal.h"
#include "evel_throttle.h"
Include dependency graph for evel_reporting_measurement.c:

Go to the source code of this file.

Functions

EVENT_REPORTevel_new_report (double measurement_interval)
 Create a new Report event. More...
 
void evel_report_type_set (EVENT_REPORT *report, const char *const type)
 Set the Event Type property of the Report. More...
 
void evel_report_feature_use_add (EVENT_REPORT *report, char *feature, int utilization)
 Add a Feature usage value name/value pair to the Report. More...
 
void evel_report_custom_measurement_add (EVENT_REPORT *report, const char *const group, const char *const name, const char *const value)
 Add a Additional Measurement value name/value pair to the Report. More...
 
void evel_json_encode_report (EVEL_JSON_BUFFER *jbuf, EVENT_REPORT *event)
 Encode the report as a JSON report. More...
 
void evel_free_report (EVENT_REPORT *event)
 Free a Report. More...
 

Detailed Description

Implementation of EVEL functions relating to the Measurement for VF Reporting event.

Note
This is an experimental event tytpe and does not form part of the currently approved AT&T event schema. It is intended to allow a less-onerous event reporting mechanism because it avoids having to return all the platform statistics which are mandatory in the measurementsForVfScaling event.

License

Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the AT&T.
  4. Neither the name of AT&T nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file evel_reporting_measurement.c.

Function Documentation

§ evel_free_report()

void evel_free_report ( EVENT_REPORT event)

Free a Report.

Free off the Report supplied. Will free all the contained allocated memory.

Note
It does not free the Report itself, since that may be part of a larger structure.

Definition at line 400 of file evel_reporting_measurement.c.

§ evel_json_encode_report()

void evel_json_encode_report ( EVEL_JSON_BUFFER jbuf,
EVENT_REPORT event 
)

Encode the report as a JSON report.

Parameters
jbufPointer to the EVEL_JSON_BUFFER to encode into.
eventPointer to the EVENT_HEADER to encode.

Definition at line 266 of file evel_reporting_measurement.c.

§ evel_new_report()

EVENT_REPORT* evel_new_report ( double  measurement_interval)

Create a new Report event.

Note
The mandatory fields on the Report must be supplied to this factory function and are immutable once set. Optional fields have explicit setter functions, but again values may only be set once so that the Report has immutable properties.
Parameters
measurement_interval
Returns
pointer to the newly manufactured EVENT_REPORT. If the event is not used (i.e. posted) it must be released using evel_free_event.
Return values
NULLFailed to create the event.

Definition at line 66 of file evel_reporting_measurement.c.

§ evel_report_custom_measurement_add()

void evel_report_custom_measurement_add ( EVENT_REPORT report,
const char *const  group,
const char *const  name,
const char *const  value 
)

Add a Additional Measurement value name/value pair to the Report.

The name is null delimited ASCII string. The library takes a copy so the caller does not have to preserve values after the function returns.

Parameters
reportPointer to the report.
groupASCIIZ string with the measurement group's name.
nameASCIIZ string containing the measurement's name.
valueASCIIZ string containing the measurement's value.

Definition at line 187 of file evel_reporting_measurement.c.

§ evel_report_feature_use_add()

void evel_report_feature_use_add ( EVENT_REPORT report,
char *  feature,
int  utilization 
)

Add a Feature usage value name/value pair to the Report.

The name is null delimited ASCII string. The library takes a copy so the caller does not have to preserve values after the function returns.

Parameters
reportPointer to the report.
featureASCIIZ string with the feature's name.
utilizationUtilization of the feature.

Definition at line 144 of file evel_reporting_measurement.c.

§ evel_report_type_set()

void evel_report_type_set ( EVENT_REPORT report,
const char *const  type 
)

Set the Event Type property of the Report.

Note
The property is treated as immutable: it is only valid to call the setter once. However, we don't assert if the caller tries to overwrite, just ignoring the update instead.
Parameters
reportPointer to the Report.
typeThe Event Type to be set. ASCIIZ string. The caller does not need to preserve the value once the function returns.

Definition at line 118 of file evel_reporting_measurement.c.