Stats: initialize start_time automatically
This commit is contained in:
parent
a3ca9963a5
commit
8f4769d2ac
@ -56,7 +56,6 @@
|
|||||||
#include "config/ConfigDefaults.hxx"
|
#include "config/ConfigDefaults.hxx"
|
||||||
#include "config/ConfigOption.hxx"
|
#include "config/ConfigOption.hxx"
|
||||||
#include "config/ConfigError.hxx"
|
#include "config/ConfigError.hxx"
|
||||||
#include "Stats.hxx"
|
|
||||||
#include "util/RuntimeError.hxx"
|
#include "util/RuntimeError.hxx"
|
||||||
|
|
||||||
#ifdef ENABLE_DAEMON
|
#ifdef ENABLE_DAEMON
|
||||||
@ -442,7 +441,6 @@ try {
|
|||||||
glue_daemonize_init(&options);
|
glue_daemonize_init(&options);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
stats_global_init();
|
|
||||||
TagLoadConfig();
|
TagLoadConfig();
|
||||||
|
|
||||||
log_init(options.verbose, options.log_stderr);
|
log_init(options.verbose, options.log_stderr);
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* The monotonic time stamp when MPD was started. It is used to
|
* The monotonic time stamp when MPD was started. It is used to
|
||||||
* calculate the uptime.
|
* calculate the uptime.
|
||||||
*/
|
*/
|
||||||
static unsigned start_time;
|
static const unsigned start_time = MonotonicClockS();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_DATABASE
|
#ifdef ENABLE_DATABASE
|
||||||
@ -47,17 +47,6 @@ enum class StatsValidity : uint8_t {
|
|||||||
|
|
||||||
static StatsValidity stats_validity = StatsValidity::INVALID;
|
static StatsValidity stats_validity = StatsValidity::INVALID;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void stats_global_init(void)
|
|
||||||
{
|
|
||||||
#ifndef WIN32
|
|
||||||
start_time = MonotonicClockS();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_DATABASE
|
|
||||||
|
|
||||||
void
|
void
|
||||||
stats_invalidate()
|
stats_invalidate()
|
||||||
{
|
{
|
||||||
|
@ -23,9 +23,6 @@
|
|||||||
class Response;
|
class Response;
|
||||||
struct Partition;
|
struct Partition;
|
||||||
|
|
||||||
void
|
|
||||||
stats_global_init();
|
|
||||||
|
|
||||||
void
|
void
|
||||||
stats_invalidate();
|
stats_invalidate();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user