From 92edb854891ea7004e5123ec5f6d328c024d5e53 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 4 Jun 2013 09:52:37 +0200 Subject: [PATCH] Rename 'path_prefix' option to 'perfdata_path'. --- lib/icinga/perfdatawriter.cpp | 12 ++++++------ lib/icinga/perfdatawriter.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/icinga/perfdatawriter.cpp b/lib/icinga/perfdatawriter.cpp index 092f59665..d84a54280 100644 --- a/lib/icinga/perfdatawriter.cpp +++ b/lib/icinga/perfdatawriter.cpp @@ -37,7 +37,7 @@ REGISTER_TYPE(PerfdataWriter); PerfdataWriter::PerfdataWriter(const Dictionary::Ptr& properties) : DynamicObject(properties) { - RegisterAttribute("path_prefix", Attribute_Config, &m_PathPrefix); + RegisterAttribute("perfdata_path", Attribute_Config, &m_PerfdataPath); RegisterAttribute("format_template", Attribute_Config, &m_FormatTemplate); RegisterAttribute("rotation_interval", Attribute_Config, &m_RotationInterval); } @@ -72,10 +72,10 @@ PerfdataWriter::Ptr PerfdataWriter::GetByName(const String& name) return dynamic_pointer_cast(configObject); } -String PerfdataWriter::GetPathPrefix(void) const +String PerfdataWriter::GetPerfdataPath(void) const { - if (!m_PathPrefix.IsEmpty()) - return m_PathPrefix; + if (!m_PerfdataPath.IsEmpty()) + return m_PerfdataPath; else return Application::GetLocalStateDir() + "/cache/icinga2/perfdata/perfdata"; } @@ -137,12 +137,12 @@ void PerfdataWriter::RotateFile(void) { ObjectLock olock(this); - String tempFile = GetPathPrefix(); + String tempFile = GetPerfdataPath(); if (m_OutputFile.good()) { m_OutputFile.close(); - String finalFile = GetPathPrefix() + "." + Convert::ToString((long)Utility::GetTime()); + String finalFile = GetPerfdataPath() + "." + Convert::ToString((long)Utility::GetTime()); (void) rename(tempFile.CStr(), finalFile.CStr()); } diff --git a/lib/icinga/perfdatawriter.h b/lib/icinga/perfdatawriter.h index 72a54f9d8..ea20eafd9 100644 --- a/lib/icinga/perfdatawriter.h +++ b/lib/icinga/perfdatawriter.h @@ -44,7 +44,7 @@ public: static PerfdataWriter::Ptr GetByName(const String& name); - String GetPathPrefix(void) const; + String GetPerfdataPath(void) const; String GetFormatTemplate(void) const; double GetRotationInterval(void) const; @@ -53,7 +53,7 @@ protected: virtual void Start(void); private: - Attribute m_PathPrefix; + Attribute m_PerfdataPath; Attribute m_FormatTemplate; Attribute m_RotationInterval;