Example #1
0
Value ServicesTable::StalenessAccessor(const Value& row)
{
	Service::Ptr service = static_cast<Service::Ptr>(row);

	if (!service)
		return Empty;

	if (service->HasBeenChecked() && service->GetLastCheck() > 0)
		return (Utility::GetTime() - service->GetLastCheck()) / (service->GetCheckInterval() * 3600);

	return 0.0;
}
Example #2
0
Value ServicesTable::LastCheckAccessor(const Value& row)
{
	Service::Ptr service = static_cast<Service::Ptr>(row);

	if (!service)
		return Empty;

	return static_cast<int>(service->GetLastCheck());
}