diff --git a/lib/redis/rediswriter-objects.cpp b/lib/redis/rediswriter-objects.cpp index d516eda26..633aa1fb5 100644 --- a/lib/redis/rediswriter-objects.cpp +++ b/lib/redis/rediswriter-objects.cpp @@ -677,8 +677,10 @@ Dictionary::Ptr RedisWriter::SerializeState(const Checkable::Ptr& checkable) } } - if (cr->GetPerformanceData()) - attrs->Set("performance_data", PluginUtility::FormatPerfdata(cr->GetPerformanceData())); + String perfData = PluginUtility::FormatPerfdata(cr->GetPerformanceData()); + if (!perfData.IsEmpty()) + attrs->Set("performance_data", perfData); + if (!cr->GetCommand().IsEmpty()) attrs->Set("commandline", FormatCommandLine(cr->GetCommand())); attrs->Set("execution_time", cr->CalculateExecutionTime());