report-json-serializer: app and top serializers
[apps/native/ttsd-worker-task.git] / src / report-json-serializer.h
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __REPORT_JSON_SERIALIZER_H_
18 #define __REPORT_JSON_SERIALIZER_H_
19
20 #include "report.h"
21
22 /**
23  * @brief Serializes system_load_average_report to json string
24  *
25  * @param[in] report Report structure with usage data.
26  *
27  * @return dynamically allocated string on NULL on error.
28  * @remark returned value should be released with @free
29  */
30 char *report_json_serializer_serialize_system_load_average_report(struct system_load_average_report *report);
31
32 /**
33  * @brief Serializes system_memory_usage_report to json string
34  *
35  * @param[in] report Report structure with usage data.
36  *
37  * @return dynamically allocated string on NULL on error.
38  * @remark returned value should be released with @free
39  */
40 char *report_json_serializer_serialize_system_memory_usage_report(struct system_memory_usage_report *report);
41
42 /**
43  * @brief Serializes system_cpus_usage_report to json string
44  *
45  * @param[in] report Report structure with usage data.
46  *
47  * @return dynamically allocated string on NULL on error.
48  * @remark returned value should be released with @free
49  */
50 char *report_json_serializer_serialize_system_cpu_usage_report(struct system_cpu_usage_report *report);
51
52 /**
53  * @brief Serializes system_cpus_usage_report to json string
54  *
55  * @param[in] report Report structure with usage data.
56  *
57  * @return dynamically allocated string on NULL on error.
58  * @remark returned value should be released with @free
59  */
60 char *report_json_serializer_serialize_system_cpus_usage_report(struct system_percpu_usage_report *report);
61
62 /**
63  * @brief Serializes process_memory_usage_report to json string
64  *
65  * @param[in] report Report structure with usage data.
66  *
67  * @return dynamically allocated string on NULL on error.
68  * @remark returned value should be released with @free
69  */
70 char *report_json_serializer_serialize_process_cpu_usage_report(struct process_cpu_usage_report *report);
71
72 /**
73  * @brief Serializes process_memory_usage_report to json string
74  *
75  * @param[in] report Report structure with usage data.
76  *
77  * @return dynamically allocated string on NULL on error.
78  * @remark returned value should be released with @free
79  */
80 char *report_json_serializer_serialize_process_memory_usage_report(struct process_memory_usage_report *report);
81
82 /**
83  * @brief Serializes app_system_cpu_usage_report to json string
84  *
85  * @param[in] report Report structure with usage data.
86  *
87  * @return dynamically allocated string on NULL on error.
88  * @remark returned value should be released with @free
89  */
90 char *report_json_serializer_serialize_apps_cpu_usage_report(struct app_cpu_usage_report *report);
91
92 /**
93  * @brief Serializes app_memory_usage_report to json string
94  *
95  * @param[in] report Report structure with usage data.
96  *
97  * @return dynamically allocated string on NULL on error.
98  * @remark returned value should be released with @free
99  */
100 char *report_json_serializer_serialize_apps_memory_usage_report(struct app_memory_usage_report *report);
101
102 /**
103  * @brief Serializes app_system_cpu_usage_reports to json string
104  *
105  * @param[in] report NULL-terminated array of report structures with usage data.
106  *
107  * @return dynamically allocated string on NULL on error.
108  * @remark returned value should be released with @free
109  */
110 char *report_json_serializer_serialize_top_cpu_usage_reports(struct app_cpu_usage_report **reports);
111
112 /**
113  * @brief Serializes app_memory_usage_reports to json string
114  *
115  * @param[in] report NULL-terminated array of report structures with usage data.
116  *
117  * @return dynamically allocated string on NULL on error.
118  * @remark returned value should be released with @free
119  */
120 char *report_json_serializer_serialize_top_memory_usage_reports(struct app_memory_usage_report **reports);
121
122 #endif