Rename 'path_prefix' option to 'perfdata_path'.

This commit is contained in:
Gunnar Beutner 2013-06-04 09:52:37 +02:00
parent 1013091c62
commit 92edb85489
2 changed files with 8 additions and 8 deletions

View 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());
}

View 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;