/* This file is part of Mysqlstat -*- autoconf -*- * Copyright (C) 2014-2016 Sergey Poznyakoff * * Mysqlstat is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * Mysqlstat is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Mysqlstat. If not, see . */ #include #include #include #include #include #include #include #include #define CACHE_TIMEOUT 10 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); void mysqlstat_disconnect(mysqlstat_connection_t); char const *mysqlstat_get(int id, char const *name);