]> granicus.if.org Git - icinga2/commitdiff
Rename 'path_prefix' option to 'perfdata_path'.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 4 Jun 2013 07:52:37 +0000 (09:52 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 4 Jun 2013 07:52:37 +0000 (09:52 +0200)
lib/icinga/perfdatawriter.cpp
lib/icinga/perfdatawriter.h

index 092f59665c0795625e28ea778143b9131a8c8f0a..d84a54280f9be90efab416e14a968f5d43d1519b 100644 (file)
@@ -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<PerfdataWriter>(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());
        }
 
index 72a54f9d83872592f5aced78bd87f6f2e9b51f20..ea20eafd97a10c13d8e1626c01987ef0f6ed736a 100644 (file)
@@ -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<String> m_PathPrefix;
+       Attribute<String> m_PerfdataPath;
        Attribute<String> m_FormatTemplate;
        Attribute<double> m_RotationInterval;