My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
controller_mysql.h
Go to the documentation of this file.
1 /*
2 START OF LICENSE STUB
3  DeDOS: Declarative Dispersion-Oriented Software
4  Copyright (C) 2017 University of Pennsylvania, Georgetown University
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 END OF LICENSE STUB
19 */
20 #ifndef CONTROLLER_MYSQL_H
21 #define CONTROLLER_MYSQL_H
22 
23 #include "dfg.h"
24 #include "stats.h"
25 
26 
27 int db_init(int clear);
28 int db_terminate();
29 
30 int db_check_and_register(const char *check_query, const char *insert_query,
31  const char *element, int thread_id);
33 int db_register_thread_stats(int thread_id, int runtime_id);
34 int db_register_msu_stats(int msu_id, int msu_type_id, int thread_id, int runtime_id);
35 int db_register_msu(int msu_id, int msu_type_id, int thread_id, int runtime_id);
36 
37 int db_insert_sample(struct timed_stat *input, struct stat_sample_hdr *input_hdr, int runtime_id);
38 
39 #endif
int db_register_runtime(int runtime_id)
Register a runtime in the DB.
int db_init(int clear)
Initialize the MySQL client library, and connect to the server Also init tables for running system...
int db_register_msu(int msu_id, int msu_type_id, int thread_id, int runtime_id)
Register an MSU in the DB.
Functions for the sending and receiving of statistics between ctrl and runtime.
Header for a single stat sample for a single item.
Definition: stats.h:43
int db_register_msu_stats(int msu_id, int msu_type_id, int thread_id, int runtime_id)
Interfaces for the creation and modification of the data-flow-graph and and general description of th...
Holds a single timestamped value.
Definition: stats.h:37
int db_insert_sample(struct timed_stat *input, struct stat_sample_hdr *input_hdr, int runtime_id)
Insert datapoint for a timseries in the DB.
static int runtime_id(int runtime_fd)
int db_terminate()
Destroy the MySQL client environment.
int db_check_and_register(const char *check_query, const char *insert_query, const char *element, int thread_id)
Register an element in the DB.
int db_register_thread_stats(int thread_id, int runtime_id)