#define FLAPPING_INTERVAL (30 * 60)
+double Service::GetFlappingCurrent(void) const
+{
+ if (m_FlappingNegative.IsEmpty() || m_FlappingPositive.IsEmpty())
+ return 0;
+
+ return 100 * m_FlappingPositive / (m_FlappingPositive + m_FlappingNegative);
+}
+
double Service::GetFlappingThreshold(void) const
{
if (m_FlappingThreshold.IsEmpty())
bool Service::IsFlapping(void) const
{
- double threshold = 20;
-
- if (!m_FlappingThreshold.IsEmpty())
- threshold = m_FlappingThreshold;
-
- if (m_FlappingNegative.IsEmpty() || m_FlappingPositive.IsEmpty())
- return false;
-
- return (m_FlappingPositive > threshold * (m_FlappingPositive + m_FlappingNegative) / 100);
-
+ return GetFlappingCurrent() > GetFlappingThreshold();
}
bool GetEnableFlapping(void) const;
void SetEnableFlapping(bool enabled);
+ double GetFlappingCurrent(void) const;
double GetFlappingThreshold(void) const;
bool IsFlapping(void) const;