]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
log: Add log_coarse_timestamps option
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 5 Oct 2017 22:34:06 +0000 (18:34 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Sat, 7 Oct 2017 00:49:53 +0000 (20:49 -0400)
And set up an observer in CephContext to coarsen/refine time stamps as
requested.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/common/ceph_context.cc
src/common/options.cc

index 3a8d992c6142e69e5282c10c75ca3fbbb359c6ab..e82a9b2b122c2dc1cdaefd2c32c0b398cd7b137f 100644 (file)
@@ -208,6 +208,7 @@ public:
       "err_to_graylog",
       "log_graylog_host",
       "log_graylog_port",
+      "log_coarse_timestamps",
       "fsid",
       "host",
       NULL
@@ -260,6 +261,10 @@ public:
       log->graylog()->set_destination(conf->log_graylog_host, conf->log_graylog_port);
     }
 
+    if (changed.find("log_coarse_timestamps") != changed.end()) {
+      log->set_coarse_timestamps(conf->_get_val<bool>("log_coarse_timestamps"));
+    }
+
     // metadata
     if (log->graylog() && changed.count("host")) {
       log->graylog()->set_hostname(conf->host);
index 6c916c8aec8860f393287df257384bf2c6c6fad1..5b8a4da681725adf4d85f72113921e2a5b80ff84 100644 (file)
@@ -389,6 +389,13 @@ std::vector<Option> get_global_options() {
     .set_description("port number for the remote graylog server")
     .add_see_also("log_graylog_host"),
 
+    Option("log_coarse_timestamps", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(true)
+    .set_description("timestamp log entries from coarse system clock "
+                    "to improve performance")
+    .add_service("common")
+    .add_tag("performance")
+    .add_tag("service"),
 
 
     // unmodified