aboutsummaryrefslogtreecommitdiff
path: root/src/mysqlstat.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-06-07 08:01:46 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-06-07 08:01:46 +0300
commit757b835af8984c1fa796aec1789b484bd307bb8a (patch)
tree7f37eec457262277ff2fe856eb2907155fded780 /src/mysqlstat.h
parentec36698ad30b99a05104952f011cf471faf83e56 (diff)
downloadmysqlstat-757b835af8984c1fa796aec1789b484bd307bb8a.tar.gz
mysqlstat-757b835af8984c1fa796aec1789b484bd307bb8a.tar.bz2
Keep MySQL connection open as long as possible. Implement new OIDs.
* src/MYSQL-STAT-MIB.txt: New OIDs: processTotalCount, processActiveCount, and processSlaveCount * src/mysqlstat.c (mysqlstat_connect): Keep connection open. (mysqlstat_disconnect): Remove. (get_process_list, process_first, process_next): New functions. Keep a cached list of processes and iterate through it. All functions updated. (process_total_count,process_active_count) (process_slave_count): New functions. * src/mysqlstat.h (process_total_count,process_active_count) (process_slave_count): New protos. * src/mysqlstat_mib.mib2c (handle_$i): Update.
Diffstat (limited to 'src/mysqlstat.h')
-rw-r--r--src/mysqlstat.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/mysqlstat.h b/src/mysqlstat.h
index 1fc724e..f4bf137 100644
--- a/src/mysqlstat.h
+++ b/src/mysqlstat.h
@@ -29,26 +29,4 @@
-enum {
- MYSQLSTAT_CACHE_REPL,
- MYSQLSTAT_MAX_CACHE
-};
-
typedef struct mysqlstat_connection *mysqlstat_connection_t;
-struct repl_stat {
- char *replMasterLogFile;
- uint32_t replReadMasterLogPos;
- char *replRelayLogFile;
- uint32_t replRelayLogPos;
- char *replRelayMasterLogFile;
- int replSlaveIORunning;
- int replSlaveSQLRunning;
- int replLastSQLErrno;
- char *replLastSQLError;
- int replLastIOErrno;
- char *replLastIOError;
- uint32_t replExecMasterLogPos;
- uint64_t replRelayLogSpace;
- uint32_t replSecondsBehindMaster;
-};
-
mysqlstat_connection_t mysqlstat_connect(void);
@@ -56,2 +34,5 @@ void mysqlstat_disconnect(mysqlstat_connection_t);
-char const *mysqlstat_get(int id, char const *name);
+uint32_t process_total_count(void);
+uint32_t process_active_count(void);
+uint32_t process_slave_count(void);
+

Return to:

Send suggestions and report system problems to the System administrator.