Changeset 29ff7e1 in nscp
- Timestamp:
- 08/07/12 23:29:55 (11 months ago)
- Branches:
- master, 0.4.1, 0.4.2
- Children:
- a35c3b3, ca3e815
- Parents:
- fff754b
- Files:
-
- 5 edited
-
changelog (modified) (1 diff)
-
include/checkHelpers.hpp (modified) (6 diffs)
-
include/strEx.h (modified) (1 diff)
-
service/NSClient++.cpp (modified) (1 diff)
-
version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
changelog
rfff754b r29ff7e1 5 5 * Fix RtlStringFromGUID problem on NT4 6 6 7 2012-08-07 MickeM 8 * Fixed issue with perfoamnce data overflowing 32-bit integers (#550) 9 * Fixed issue with CheckUptime and time rendering beein wrong (#549) 10 7 11 2012-08-04 MickeM 8 12 * Re implemented INSTANCES command via the new pdh exec subsystem. -
include/checkHelpers.hpp
rc3f233d r29ff7e1 720 720 }; 721 721 722 checkTypes type_;723 typename TType::TValueType value_;724 722 typedef typename TType TValueType; 725 723 typedef THandler TFormatType; 726 724 typedef NumericPercentageBounds<TType, THandler> TMyType; 725 726 checkTypes type_; 727 typename TType::TValueType value_; 727 728 InternalValue upper; 728 729 InternalValue lower; … … 730 731 double magic; 731 732 732 NumericPercentageBounds() : type_(none), upper(true), lower(false), magic(0), normal_size(20*1024*1024) {733 NumericPercentageBounds() : type_(none), value_(0), upper(true), lower(false), normal_size(20*1024*1024), magic(0) { 733 734 upper.setParent(this); 734 735 lower.setParent(this); … … 738 739 : type_(other.type_) 739 740 , value_(other.value_) 740 , magic(other.magic)741 , normal_size(other.normal_size)742 741 , upper(other.upper) 743 742 , lower(other.lower) 743 , normal_size(other.normal_size) 744 , magic(other.magic) 744 745 { 745 746 upper.setParent(this); … … 751 752 type_ = other.type_; 752 753 value_ = other.value_; 753 magic = other.magic;754 normal_size = other.normal_size;755 754 upper = other.upper; 756 755 lower = other.lower; 756 normal_size = other.normal_size; 757 magic = other.magic; 757 758 upper.setParent(this); 758 759 lower.setParent(this); … … 839 840 warn_p = evaluate_value_to_percentage(value.total, warn); 840 841 crit_p = evaluate_value_to_percentage(value.total, crit); 841 warn_v = static_cast<unsigned int>(warn);842 crit_v = static_cast<unsigned int>(crit);842 warn_v = warn; 843 crit_v = crit; 843 844 } else { 844 845 value_p = static_cast<unsigned int>(value.getLowerPercentage()); 845 846 warn_p = evaluate_value_to_percentage(value.total, warn); 846 847 crit_p = evaluate_value_to_percentage(value.total, crit); 847 warn_v = static_cast<unsigned int>(warn);848 crit_v = static_cast<unsigned int>(crit);849 } 850 std::wstring unit = THandler::get_perf_unit(min (warn_v, min(crit_v, value.value)));848 warn_v = warn; 849 crit_v = crit; 850 } 851 std::wstring unit = THandler::get_perf_unit(min_no_zero(warn_v, crit_v, value.value)); 851 852 return 852 853 MAKE_PERFDATA(alias + _T(" %"), THandler::print_unformated(value_p), _T("%"), THandler::print_unformated(warn_p), THandler::print_unformated(crit_p)) … … 855 856 THandler::print_perf(0, unit), THandler::print_perf(value.total, unit)) 856 857 ; 858 } 859 template<class T> 860 T min_no_zero(T v1, T v2, T v3) { 861 if (v1 == 0 && v2 == 0 && v3 == 0) 862 return 0; 863 T maximum = max(v1, max(v2, v3)); 864 if (v1 == 0) 865 v1 = maximum; 866 if (v2 == 0) 867 v2 = maximum; 868 if (v3 == 0) 869 v3 = maximum; 870 return min(v1, min(v2, v3)); 857 871 } 858 872 std::wstring gatherPerfData(std::wstring alias, TType &value) { -
include/strEx.h
r6090c98 r29ff7e1 358 358 inline std::wstring itos_as_time(unsigned long long time) { 359 359 if (time > WEEK) { 360 unsigned int w = static_cast<unsigned int>(time/WEEK);361 unsigned int d = static_cast<unsigned int>((time-(w*WEEK))/DAY);362 unsigned int h = static_cast<unsigned int>((time-(w*WEEK)-(d*DAY))/HOUR);363 unsigned int m = static_cast<unsigned int>((time-(w*WEEK)-(d*DAY)-(h*HOUR))/MIN);360 long long w = time/WEEK; 361 long long d = (time-(w*WEEK))/DAY; 362 long long h = (time-(w*WEEK)-(d*DAY))/HOUR; 363 long long m = (time-(w*WEEK)-(d*DAY)-(h*HOUR))/MIN; 364 364 return itos(w) + _T("w ") + itos(d) + _T("d ") + itos(h) + _T(":") + itos(m); 365 365 } 366 366 else if (time > DAY) { 367 unsigned int d = static_cast<unsigned int>((time)/DAY);368 unsigned int h = static_cast<unsigned int>((time-(d*DAY))/HOUR);369 unsigned int m = static_cast<unsigned int>((time-(d*DAY)-(h*HOUR))/MIN);367 long long d = time/DAY; 368 long long h = (time-(d*DAY))/HOUR; 369 long long m = (time-(d*DAY)-(h*HOUR))/MIN; 370 370 return itos(d) + _T("d ") + itos(h) + _T(":") + itos(m); 371 371 } 372 372 else if (time > HOUR) { 373 unsigned int h = static_cast<unsigned int>((time)/HOUR);374 unsigned int m = static_cast<unsigned int>((time-(h*HOUR))/MIN);373 long long h = time/HOUR; 374 long long m = (time-(h*HOUR))/MIN; 375 375 return itos(h) + _T(":") + itos(m); 376 376 } else if (time > MIN) { 377 return _T("0:") + itos( static_cast<unsigned int>(time/(60 * 1000)));377 return _T("0:") + itos(time/MIN); 378 378 } else if (time > SEC) 379 return itos( static_cast<unsigned int>(time/(1000))) + _T("s");380 return itos( static_cast<unsigned int>(time));379 return itos(time/SEC) + _T("s"); 380 return itos(time); 381 381 } 382 382 -
service/NSClient++.cpp
rf14ab71 r29ff7e1 393 393 LOG_INFO_CORE(SERVICE_NAME _T(" booting...")); 394 394 LOG_DEBUG_CORE(_T("Booted settings subsystem...")); 395 LOG_ERROR_CORE(_T("===> ") + strEx::itos_as_time(11171600000)); 395 396 396 397 bool crash_submit = false; -
version.txt
r48b6b97 r29ff7e1 1 1 version=0.4.1 2 build=3 23 date=2012-08-0 62 build=35 3 date=2012-08-07
Note: See TracChangeset
for help on using the changeset viewer.








