diff --git a/WebAdmin.iml b/WebAdmin.iml index 70131af..d464eb7 100644 --- a/WebAdmin.iml +++ b/WebAdmin.iml @@ -2,6 +2,9 @@ + + + @@ -10,7 +13,7 @@ - + diff --git a/lib/libsigar-amd64-freebsd-6.so b/lib/libsigar-amd64-freebsd-6.so index 9ec33a9..3e94f0d 100644 Binary files a/lib/libsigar-amd64-freebsd-6.so and b/lib/libsigar-amd64-freebsd-6.so differ diff --git a/lib/libsigar-amd64-linux.so b/lib/libsigar-amd64-linux.so index 49b2f05..5a2e4c2 100644 Binary files a/lib/libsigar-amd64-linux.so and b/lib/libsigar-amd64-linux.so differ diff --git a/lib/libsigar-amd64-solaris.so b/lib/libsigar-amd64-solaris.so index ae9a4f1..6396482 100644 Binary files a/lib/libsigar-amd64-solaris.so and b/lib/libsigar-amd64-solaris.so differ diff --git a/lib/libsigar-ia64-hpux-11.sl b/lib/libsigar-ia64-hpux-11.sl index 1dc74db..d92ea4a 100644 Binary files a/lib/libsigar-ia64-hpux-11.sl and b/lib/libsigar-ia64-hpux-11.sl differ diff --git a/lib/libsigar-pa-hpux-11.sl b/lib/libsigar-pa-hpux-11.sl index c63eb22..0dfd8a1 100644 Binary files a/lib/libsigar-pa-hpux-11.sl and b/lib/libsigar-pa-hpux-11.sl differ diff --git a/lib/libsigar-ppc-aix-5.so b/lib/libsigar-ppc-aix-5.so index 480c440..7d4b519 100644 Binary files a/lib/libsigar-ppc-aix-5.so and b/lib/libsigar-ppc-aix-5.so differ diff --git a/lib/libsigar-ppc-linux.so b/lib/libsigar-ppc-linux.so index d5637a7..4394b1b 100644 Binary files a/lib/libsigar-ppc-linux.so and b/lib/libsigar-ppc-linux.so differ diff --git a/lib/libsigar-ppc64-aix-5.so b/lib/libsigar-ppc64-aix-5.so index 9a3a737..35fd828 100644 Binary files a/lib/libsigar-ppc64-aix-5.so and b/lib/libsigar-ppc64-aix-5.so differ diff --git a/lib/libsigar-ppc64-linux.so b/lib/libsigar-ppc64-linux.so index 4875241..a1ba252 100644 Binary files a/lib/libsigar-ppc64-linux.so and b/lib/libsigar-ppc64-linux.so differ diff --git a/lib/libsigar-s390x-linux.so b/lib/libsigar-s390x-linux.so index ae8ac4b..c275f4a 100644 Binary files a/lib/libsigar-s390x-linux.so and b/lib/libsigar-s390x-linux.so differ diff --git a/lib/libsigar-sparc-solaris.so b/lib/libsigar-sparc-solaris.so index 507effe..aa847d2 100644 Binary files a/lib/libsigar-sparc-solaris.so and b/lib/libsigar-sparc-solaris.so differ diff --git a/lib/libsigar-sparc64-solaris.so b/lib/libsigar-sparc64-solaris.so index 1a4bc18..6c4fe80 100644 Binary files a/lib/libsigar-sparc64-solaris.so and b/lib/libsigar-sparc64-solaris.so differ diff --git a/lib/libsigar-universal-macosx.dylib b/lib/libsigar-universal-macosx.dylib index 4a35824..27ab107 100644 Binary files a/lib/libsigar-universal-macosx.dylib and b/lib/libsigar-universal-macosx.dylib differ diff --git a/lib/libsigar-universal64-macosx.dylib b/lib/libsigar-universal64-macosx.dylib index dc27122..0c721fe 100644 Binary files a/lib/libsigar-universal64-macosx.dylib and b/lib/libsigar-universal64-macosx.dylib differ diff --git a/lib/libsigar-x86-freebsd-5.so b/lib/libsigar-x86-freebsd-5.so index 67de5df..8c50c61 100644 Binary files a/lib/libsigar-x86-freebsd-5.so and b/lib/libsigar-x86-freebsd-5.so differ diff --git a/lib/libsigar-x86-freebsd-6.so b/lib/libsigar-x86-freebsd-6.so index 7b3a264..f080027 100644 Binary files a/lib/libsigar-x86-freebsd-6.so and b/lib/libsigar-x86-freebsd-6.so differ diff --git a/lib/libsigar-x86-linux.so b/lib/libsigar-x86-linux.so index 5d2630e..a0b64ed 100644 Binary files a/lib/libsigar-x86-linux.so and b/lib/libsigar-x86-linux.so differ diff --git a/lib/libsigar-x86-solaris.so b/lib/libsigar-x86-solaris.so index ea33591..c6452e5 100644 Binary files a/lib/libsigar-x86-solaris.so and b/lib/libsigar-x86-solaris.so differ diff --git a/lib/sigar-amd64-winnt.dll b/lib/sigar-amd64-winnt.dll index 0d2977f..1ec8a03 100644 Binary files a/lib/sigar-amd64-winnt.dll and b/lib/sigar-amd64-winnt.dll differ diff --git a/lib/sigar-x86-winnt.dll b/lib/sigar-x86-winnt.dll index 7b29a4e..6afdc01 100644 Binary files a/lib/sigar-x86-winnt.dll and b/lib/sigar-x86-winnt.dll differ diff --git a/lib/sigar-x86-winnt.lib b/lib/sigar-x86-winnt.lib index 928b2c7..04924a1 100644 Binary files a/lib/sigar-x86-winnt.lib and b/lib/sigar-x86-winnt.lib differ diff --git a/lib/sigar.jar b/lib/sigar.jar index 8fe8400..58c733c 100644 Binary files a/lib/sigar.jar and b/lib/sigar.jar differ diff --git a/lib/sigar_AUTHORS b/lib/sigar_AUTHORS new file mode 100644 index 0000000..40ca23a --- /dev/null +++ b/lib/sigar_AUTHORS @@ -0,0 +1,23 @@ +Doug MacEachern + +Jan Kneschke + +Matthew Kent + +Ryan Beasley + +Bjoern Martin + +Kay Ropke + +Ryan Morgan + +Monty Taylor + +Trevor Pounds + +Jon Travis + +Tony Ashburner + +Ryan Bloom diff --git a/lib/sigar_ChangeLog b/lib/sigar_ChangeLog new file mode 100644 index 0000000..258ad1e --- /dev/null +++ b/lib/sigar_ChangeLog @@ -0,0 +1,1062 @@ +2010-04-28 Doug MacEachern + + * 1.6.4 release + + * GPL v2 license -> Apache 2 license + + * (SIGAR-188) implement mem actual free/used on Windows + +2010-04-27 Doug MacEachern + + * (SIGAR-215) use swapctl SC_LIST for Solaris swap_get impl + +2010-04-15 Doug MacEachern + + * osf1 no longer supported + + * netware no longer supported + + * (SIGAR-201) JNIEnv->ExceptionCheck to avoid possible SEGV on OutOfMemoryError + +2010-04-14 Doug MacEachern + + * (SIGAR-192) avoid possible stack corruption in Windows proc_env impl + + * (SIGAR-213) check ENV.ANT_HOME/lib for junit in Main-Class + +2010-04-09 Doug MacEachern + + * (SIGAR-214) properly adjust jni.javahome when JAVA_HOME is not set + +2010-04-08 Doug MacEachern + + * cpptasks patches moved to http://github.com/dougm/ant-contrib-cpptasks + + * mv tools/PerfBrowser http://github.com/dougm/csharp-perfbrowser + + * mv exp/ http://github.com/dougm/sigar-stuff + +2010-04-07 Doug MacEachern + + * (SIGAR-213) remove junit.jar from distribution + + * (SIGAR-188) implement mem actual free/used on HPUX + + * (SIGAR-188) implement mem actual free/used on AIX + +2010-04-05 Doug MacEachern + + * (SIGAR-188) implement mem actual free/used on OpenBSD and NetBSD + + * (SIGAR-188) implement mem actual free/used on Solaris + +2010-04-02 Doug MacEachern + + * (SIGAR-212) pass LANG_ENGLISH to FormatMessage in Windows sigar_strerror impl + +2010-04-01 Doug MacEachern + + * (SIGAR-188) implement mem actual free/used on Windows + +2010-04-01 Trevor Pounds + + * (SIGAR-202) Change CreateFile() access flags to prevent potential inode calculation + errors on Windows when tailing a file. + +2010-04-01 Doug MacEachern + + * (SIGAR-207) append instance index in Pdh.getInstances() + +2010-03-31 Doug MacEachern + + * (SIGAR-207) Add Pdh.getCounterType method + + * (SIGAR-207) Add Pdh.getDescription method + + * (SIGAR-210) recognize cifs as a network file system + +2010-03-30 Doug MacEachern + + * (SIGAR-211) HPUX file_system_list needs to read /etc/mnttab instead of /etc/fstab + +2010-02-09 Doug MacEachern + + * add -i (inode format) support to df command + +2010-02-05 Doug MacEachern + + * (SIGAR-205) Vista and higher changed wireless card type to IF_TYPE_IEEE80211 + +2010-01-18 Doug MacEachern + + * rid dup in solaris route_list impl + +2010-01-17 Doug MacEachern + + * (SIGAR-181) fill-in sigar_net_route_t.ifname on HPUX + +2010-01-12 Doug MacEachern + + * (SIGAR-196) use pst_processor.psp_cpu_frequency to calculate cpu_info.mhz on HP-UX 11.31+ + +2010-01-04 Doug MacEachern + + * (SIGAR-194) sigar_file_system_t.dev_name on Windows should be the network path for remote drives + +2009-12-23 Doug MacEachern + + * (SIGAR-193) Migrate from mach/shared_memory_server.h to mach/shared_region.h on Darwin + +2009-11-09 Doug MacEachern + + * only display event code in toString as the Event Viewer does + + * 'N/A' for null user in EventLogRecord.toString + + * include the same fields as Event Viewer in EventLogRecord.toString + + * (SIGAR-191) fix EventLogRecord.computerName + + * (SIGAR-190) add category to EventLogRecord + +2009-11-05 Doug MacEachern + + * (SIGAR-189) ignore CP_WAIT time on HPUX + +2009-11-03 Doug MacEachern + + * (SIGAR-187) implement proc_exe on AIX + + * (SIGAR-188) implement mem actual free/used on MacOSX + +2009-11-02 Doug MacEachern + + * (SIGAR-188) implement mem actual free/used on FreeBSD + +2009-10-23 Doug MacEachern + + * Pdh test adjustments for windows 2000 + + * (SIGAR-185) fix RegistryKey open on windows 2000 + + * (SIGAR-186) fix Win32.getFileVersion on windows 2000 + +2009-09-30 Doug MacEachern + + * hpux pa 64-bit support + +2009-09-17 Doug MacEachern + + * 64-bit MacOSX 10.6 sdk does not support ppc64, switch from universal build to i386 only + +2009-09-15 Doug MacEachern + + * (SIGAR-181) net_route.ifname impl for Win32 + + * (SIGAR-181) net_route.ifname impl for MacOSX and *BSD + + * (SIGAR-182) use mib2_ip_t.ipRouteEntrySize to determine mib2_ipRouteEntry_t size + +2009-09-08 Doug MacEachern + + * fix MacOSX10.6.sdk build issues + +2009-09-01 Doug MacEachern + + * (SIGAR-168) always fallback to wmi when peb fails for proc_args + +2009-08-30 Doug MacEachern + + * 6.1 == Windows 7 + + * 10.6 == Snow Leopard + +2009-08-23 Doug MacEachern + + * (SIGAR-179) Increase buffer size in cpu_list query from 16 to 128 + +2009-08-11 Jan Kneschke + + * (SIGAR-137) sdl_data isn't 0-terminated + +2009-08-05 Doug MacEachern + + * try wmi if peb fails for proc_exe + + * add wmi proc_args wrapper + +2009-07-31 Doug MacEachern + + * only exclude nfs/rpcv2.h on FreeBSD 8+ + +2009-07-30 Doug MacEachern + + * net_route_list bandaid for FreeBSD 8.0 + + * sigar_proc_port_get does not compile on FreeBSD 8.0 + + * only need nfs/rpcv2.h on darwin + +2009-07-18 Doug MacEachern + + * (SIGAR-164) return ENXIO instead of ENOENT in disk_usage win32 impl + + * (SIGAR-164) return ENXIO instead of ENOENT in disk_usage linux impl + + * (SIGAR-164) return ENXIO instead of ENOENT in disk_usage aix impl + + * (SIGAR-164) return ENXIO instead of ESRCH in disk_usage darwin impl + +2009-07-17 Doug MacEachern + + * (SIGAR-163) Recognize cvfs (StorNext) as local filesystem type + +2009-07-16 Doug MacEachern + + * (SIGAR-162) plug possible memory leak in sigar_iodev_get util + +2009-07-14 Doug MacEachern + + * remove pdh.dll (only used on NT 4.0) + +2009-07-13 Doug MacEachern + + * (SIGAR-155) Plug memory leak sigar_proc_exe_get Darwin impl + + * bump version to 1.6.4 + +2008-07-13 Doug MacEachern + + * 1.6.3 release + +2009-07-08 Doug MacEachern + + * (SIGAR-130) Use pstat(PSTAT_GETCOMMANDLINE,...) on HP-UX < 11iv2 + + * (SIGAR-130) Use pstat_getcommandline on HP-UX 11iv2+ + + * (SIGAR-131) switch to pst_fileinfo2 on all HPUX flavors + +2009-07-08 Jon Travis + + * (SIGAR-150) Wrapper class to synchronize Sigar method invocation + +2009-07-07 Doug MacEachern + + * add getNetServicesName to SigarProxy interface + +2009-07-02 Doug MacEachern + + * (SIGAR-145) default to 'Irix mode' for proc_cpu.percent + + * (SIGAR-144) Solaris net_interface_stat should use 64-bit kstats + +2009-07-01 Doug MacEachern + + * (SIGAR-148) statfs usage compiled with LFS flags + +2009-06-30 Doug MacEachern + + * (SIGAR-152) Add support for 31-bit s390 builds + +2009-06-17 Doug MacEachern + + * darwin sigar_dlinfo_modules impl + +2009-06-06 Doug MacEachern + + * (SIGAR-151) Add Modules support to PTQL + +2009-06-01 Kay Röpke + + * (SIGAR-149) fix Darwin side of SIGAR-47: integer multlipcation overflow on + 32bit builds with more than 4GB available memory + +2009-05-24 Doug MacEachern + + * (SIGAR-142) loosen net_interface_list filters on MacOSX + +2009-05-15 Doug MacEachern + + * (SIGAR-150) make SigarProxyCached.invoke synchronized + +2009-05-13 Doug MacEachern + + * fix so SigarPermissionDeniedException is throw on open /dev/kmem EACCES + + * add 64-bit compile/link flags for AIX + + * require libperfstat on aix + +2009-04-25 Doug MacEachern + + * getrusage on NetBSD may not return monotonically increasing + values for CPU time. + + * (SIGAR-39) Use kern.cp_times in cpu_list on FreeBSD 7.x+ + +2009-03-27 Doug MacEachern + + * (SIGAR-141) sigar.jar location is not required to find native library + +2009-03-25 Doug MacEachern + + * (SIGAR-140) interface aliases are valid in sigar_net_interface_config_primary_get + +2008-02-13 Doug MacEachern + + * 1.6.2 release + +2009-02-12 Doug MacEachern + + * (SIGAR-134) use UNICODE in EventLog wrapper + +2009-02-10 Doug MacEachern + + * (SIGAR-73) check for 'ocfs' in addition to 'ocfs2' + +2009-02-08 Doug MacEachern + + * (SIGAR-138) Recognize zfs as local filesystem type + +2009-02-06 Doug MacEachern + + * fix osx version on 64-bit platforms + + * [SIGAR-133] use InputStream.skip (bytes) instead of Reader.skip (chars) in onChange + + * [SIGAR-132] Fix possible memory leak in sigar_rpc_ping + + * [SIGAR-129] fix possible integer overflow in time_now_millis + + * [SIGAR-129] add another sanity check + + * [SIGAR-129] prevent possible wrapping + + * [SIGAR-129] prevent possible integer overflow + + * [SIGAR-127] use KERN_ARGMAX for KERN_PROCARGS2 buffer size + + * [SIGAR-126] /dev/kmem not usable in aix 6 + + * rid "warning: cast from pointer to integer of different size" on 64-bit builds + + * [SIGAR-125] bring back /private/var/vm swap impl for osx 10.3 + + * [SIGAR-123] do not include global shared text+data region size + + * [SIGAR-122] ARG_MAX undefined on glibc 2.8 + +2008-09-13 Doug MacEachern + + * include ptql and log in dist headers + + * dont include ant and mx4j jars in dist + + * add cpu_perc typemap to bindings/perl + +2008-09-11 Doug MacEachern + + * [SIGAR-120] Support WoW registry reflection + +2008-09-08 Doug MacEachern + + * [SIGAR-119] Use 64-bit performance counter for uptime + +2008-09-06 Doug MacEachern + + * 1.6 released, change summary: + + * OpenBSD support (binaries not included) + + * NetBSD support (binaries not included) + + * CPU list functions now return entry per-core rather than + per-socket rollup + + * Added CPU irq, softirq and stolen metrics + + * PTQL enhancements for Windows Services + + * Added interface to Windows GetFileVersionInfo function + + * Bug fixes: http://jira.hyperic.com/secure/IssueNavigator.jspa?requestId=10710 + +2008-02-01 Doug MacEachern + + * 1.5 released, change summary: + + * PTQL impl ported from Java to C + + * Added api for TCP-MIB metrics + + * Added api for NFS client+server metrics + + * Started bindings for Ruby, Python and PHP + + * Bug fixes: http://jira.hyperic.com/secure/IssueNavigator.jspa?requestId=10500 + +2007-04-14 Doug MacEachern + + * 1.4 released + +2007-04-06 Doug MacEachern + + * [SIGAR-47] Fix sigar_mem_get on 64-bit FreeBSD + +2007-04-05 Doug MacEachern + + * Add net_listen_address function to lookup bind address of a listen socket + + * Add net_stat_port function to provide metrics on specific port+address + + * [SIGAR-46] Fix cpu_info.{mhz,cache_size} fields in UML vms + +2007-03-29 Doug MacEachern + + * Fix cpu ticks to msec on linux/ia64 + Submitted by: Jan Kneschke + +2007-03-24 Doug MacEachern + + * Implement proc_state_t.threads on OS X + +2007-03-11 Doug MacEachern + + * Implement native sigar_proc_cpu_get function + +2007-03-07 Doug MacEachern + + * Plug various handle+mem leaks on win32 + Submitted by: Jan Kneschke + +2007-03-04 Doug MacEachern + + * [SIGAR-29] Add pdh language translation support + + * Add RegistryKey.getMultiStringValue() + + * Add win32.LocaleInfo class + +2007-02-28 Doug MacEachern + + * Add signal name lookup support + +2007-02-24 Doug MacEachern + + * Make Java objects returned by Sigar class Serializable + +2007-02-21 Doug MacEachern + + * Perl binding updates + Submitted by: Nicolas Laurent + + * [SIGAR-45] Fix disk reads/writes for LVM managed volumes + +2007-02-15 Doug MacEachern + + * [SIGAR-42] Honor Solaris mnttab ignore flag in file_system_list + +2007-02-12 Doug MacEachern + + * [SIGAR-17] Fix possible bad cpu list number on Solaris + +2007-02-07 Doug MacEachern + + * Make sure solaris has _POSIX_PTHREAD_SEMANTICS defined + Submitted by: Jan Kneschke + +2007-02-06 Doug MacEachern + + * Fix possible overflow in FreeBSD cpu_get impl + Submitted by: Jan Kneschke + +2007-02-02 Doug MacEachern + + * [SIGAR-40] Change win32 file_system_list to ignore removable disks + such as floppy, usb, etc. + +2007-01-29 Doug MacEachern + + * [SIGAR-38] Change win32 swap_get to use GlobalMemoryStatusEx + +2007-01-24 Doug MacEachern + + * Add proper thread_cpu impl for OS X + +2007-01-23 Doug MacEachern + + * Fix proc_mem.size on HP-UX + Submitted by: Ragnar + +2007-01-22 Doug MacEachern + + * [SIGAR-32] Fix FileTail on Windows + +2007-01-19 Doug MacEachern + + * [SIGAR-31] Improve truncation detection in FileTail + +2007-01-18 Doug MacEachern + + * Add EventLog.getLogNames() method + +2007-01-17 Doug MacEachern + + * Various fixes for sparc64 + +2007-01-09 Doug MacEachern + + * Add XenSource vendor support to sys_info api + +2006-12-10 Doug MacEachern + + * 1.3 released + +2006-12-04 Doug MacEachern + + * Added Java wrapper for VMware vmcontrol API + + * [SIGAR-26] Change Pdh.getFormattedValue() to collect 2 counters if needed + +2006-12-03 Doug MacEachern + + * [SIGAR-19] Change cpu time units to milliseconds + +2006-11-05 Doug MacEachern + + * [SIGAR-23] Overhaul windows net_interface_* implementations to + ensure data is reported for the correct interface + +2006-11-03 Doug MacEachern + + * [SIGAR-24] Any network adapter with a description of + "Microsoft Loopback Adapter" is now flagged LOOPBACK + +2006-10-27 Doug MacEachern + + * [SIGAR-22] Prevent RuntimeException in FileTail impl from + killing the FileWatcherThread + +2006-10-24 Doug MacEachern + + * [SIGAR-20] Fix windows sigar_net_inteface_list to handle > 100 + interfaces (internal buffer size was fixed at 8k) + +2006-10-19 Doug MacEachern + + * Compile on Windows AMD x64 + Submitted by: Jan Kneschke + + * Changes to compile with modern visual studios on Windows + +2006-10-10 Doug MacEachern + + * [SIGAR-18] Change Linux impl to use strtoull() where appropriate + +2006-09-30 Doug MacEachern + + * OperatingSystem.java has been ported to the C sigar_sys_info API + +2006-09-21 Doug MacEachern + + * [SIGAR-15] Fix sigar_fqdn_get so 'hostname' won't be resolved to 'localhost.localdomain' + +2006-09-20 Doug MacEachern + + * Use kstat.cpu_info.brand to determine sigar_cpu_info_t.vendor on Solaris 10+ + + * Fix Linux cpu_info /proc/cpuinfo parsing on ia64 + +2006-09-08 Doug MacEachern + + * [SIGAR-13] Use EnumProcesses for sigar_proc_list_get on Win32 + +2006-09-07 Doug MacEachern + + * [SIGAR-14] Fix sigar_cpu_t.total on Linux and Solaris with multi-core CPUs + +2006-08-25 Doug MacEachern + + * Implement proc_env for Darwin + +2006-08-24 Doug MacEachern + + * Sigar.getProc*(String) methods now convert PTQL queries + +2006-08-04 Doug MacEachern + + * Port hpux impl to ia64 arch + +2006-07-24 Doug MacEachern + + * [SIGAR-11] Initialize log fields in solaris_sigar.c:sigar_os_open + +2006-07-15 Doug MacEachern + + * 1.2 released + + * [SIGAR-10] Fix sigar_net_info_get /etc/resolv.conf parsing + +2006-07-13 Doug MacEachern + + * Validate that sigar.jar is binary compatible with the native library + +2006-07-11 Doug MacEachern + + * Port linux impl to ppc64 arch + + * [SIGAR-9] Fix possible overflow in solaris sigar_mem_get impl + +2006-07-10 Doug MacEachern + + * [SIGAR-4] Implement native sigar_net_stat_get and use w/ Java + +2006-07-07 Doug MacEachern + + * [SIGAR-8] Change win32 mem_get to use GlobalMemoryStatusEx + +2006-07-06 Doug MacEachern + + * Change AIX impl to use libperfstat where available for net_interface_stat + + * Change sigar_net_route_t, net_interface_config_t and + sigar_net_connection_t to use sigar_net_address_t + +2006-06-30 Doug MacEachern + + * Remove mem.shared, gone in Linux 2.6 and which only left Solaris and Win32 + +2006-06-27 Doug MacEachern + + * Created SIGAR_1_1 branch, trunk is now 1.2 + + * Java net.hyperic package renamed to org.hyperic + +2006-06-21 Doug MacEachern + + * [SIGAR-7] Convert sectors to bytes in Linux file system + read/write bytes metrics + +2006-06-09 Doug MacEachern + + * [SIGAR-6] Use rounding for mem.ram on Linux rather than + /proc/mtrr if write-back registers don't add up to a reasonable number + + * [SIGAR-5] Fix netinfo default gateway where the first gateway in the routing table + had been selected without checking for the default destination == 0.0.0.0 + +2006-05-30 Doug MacEachern + + * Prevent possible integer overflow in filesystem_usage + +2006-05-24 Doug MacEachern + + * ProcUtil.getJavaMainClass improvements + +2006-05-04 Doug MacEachern + + * Fold UltraSPARC-T1 virtual cpus into physical cpus + + * Fix net_connection_list on linux to handle invalid /proc/net/tcp entries + + * Switch to universal binary for osx + +2006-04-03 Doug MacEachern + + * Fix sigar_proc_args_get on linux and osx when argv has an empty "" arg + +2006-03-31 Doug MacEachern + + * Added binary for FreeBSD 6.x + +2006-03-16 Doug MacEachern + + * Remove Darwin proc_mem.shared impl. More trouble that it is + worth and the code did not compile on x86. + +2006-03-14 Doug MacEachern + + * Enhance native library finder to work with -jar foo.jar and + within an IDE such as Eclipse + +2006-03-08 Doug MacEachern + + * 1.1.29 released + +2006-03-04 Doug MacEachern + + * Add net_interface_config.description + + * Use IFMIB (GetIfEntry) rather netbios to get hwaddr on Win32 + + * Add net_interface_config.mtu for Win32 + +2006-03-03 Doug MacEachern + + * Removed proc_mem.vsize (same as proc_mem.size) + + * Removed proc_mem.rss (same as proc_mem.resident) + +2006-03-01 Doug MacEachern + + * 1.1.28 released + +2006-02-28 Doug MacEachern + + * Add Sigar.getNetListenAddress method + + * Add Sigar.getNetInterfaceConfig() method + +2006-02-26 Doug MacEachern + + * Replace sigar_nfs_ping with generic sigar_rpc_ping + +2006-02-23 Doug MacEachern + + * Use asm/cpuid instead of /proc/cpuinfo to detect + HyperThreading on Linux + + * Use gethostbyname_r in sigar_fqdn_get + +2006-01-10 Doug MacEachern + + * Add ProcUtil class + + * Pdh: if counter name does not exist, try appending "/sec" + + * Add Win32.findExecutable method + + * Add win32.Service.{pause,resume} methods + +2006-01-04 Doug MacEachern + + * Fix cpu_list on Darwin + + * Add FreeBSD 4.x support + +2005-12-19 Doug MacEachern + + * 1.1.27 released + + * Add net_interface_config.mtu for Solaris, HPUX, AIX + + * Add version api for native binaries + + * Add dir_usage api, recursive version of dir_stat api + + * Add dir_stat.disk_usage field + +2005-12-12 Doug MacEachern + + * Fix internal hash table used for caching to properly rehash + + * Fix overzealous cache in net_interface_stat on Darwin + + * Solaris fixes to keep kstat chain up-to-date + + * Fallback to /usr/ucb/ps on solaris for proc_args if permissions + deny reading /proc/nnnnn/as + + * Add option to use sudo+cat with FileTail + +2005-12-05 Doug MacEachern + + * 1.1.26 released + + * Filter out network interface types other than loopback and + ethernet on Darwin and FreeBSD + + * Filter out auto-mounted filesystems on Darwin + +2005-12-01 Doug MacEachern + + * Fix net_route_list for Solaris 10 + + * Add sigar_cpu_info_t.{mhz,cache_size,model} for Darwin + + * Fix OperatingSystem.getDescription() for Darwin + +2005-11-28 Doug MacEachern + + * 1.1.25 released + + * Fix sigar_file_system_usage_t.free_files for Solaris and Darwin + +2005-11-23 Doug MacEachern + + * Add sigar_proc_mem page fault metrics for AIX, Darwin, HPUX, + Linux, Solaris and Win32 + +2005-11-22 Doug MacEachern + + * Add sigar_proc_state.processor for AIX, HPUX, Linux and + Solaris + + * Add sigar_proc_state.threads for AIX, HPUX, Linux (2.6+), + Solaris and Win32 + +2005-11-18 Doug MacEachern + + * net_interface related changes to support VMware vmnic + + * Add sigar_net_interface_config.type field + +2005-11-11 Doug MacEachern + + * Add dmalloc support for linux and solaris + (enable w/ -Djni.dmalloc=true) + +2005-11-08 Doug MacEachern + + * 1.1.24 released + + * fix possible segv in sigar_fqdn_get + + * fix possible fault in sigar_filesystem_usage_get on win32 if + LogicalDisk perf counters are uninstalled + +2005-11-01 Doug MacEachern + + * proc_mem.resident for all platforms + +2005-10-10 Doug MacEachern + + * 1.1.23 released + +2005-10-08 Doug MacEachern + + * Add support for solaris 'bge' network interface metrics + + * Add win32 sigar_who_list impl + + * sigar_proc_args fixes for linux and solaris + + * java -Dsigar.nativeLogging=true enables native logging + +2005-09-24 Doug MacEachern + + * 1.1.22 released + +2005-07-18 Doug MacEachern + + * Add net_info function + + * Add various helpers to OperatingSystem class + +2005-07-07 Doug MacEachern + + * Add resource_limit function + + * Fix sigar_file_attrs_get times on win32 + +2005-06-25 Doug MacEachern + + * Add win32 ServiceConfig class and Service.getConfig method + +2005-06-16 Doug MacEachern + + * 1.1.21 released + + * Implement proc_mem for Darwin + + * Include darwin binary (OSX Tiger) + +2005-06-14 Doug MacEachern + + * Pdh.getSingleValue renamed to Pdh.getRawValue + + * Added Pdh.getFormattedValue method + +2005-05-25 Doug MacEachern + + * Implement sigar_proc_args for Darwin + +2005-05-11 Doug MacEachern + + * 1.1.20 released + + * Use psapi instead of CreateTool32Snapshot in win32 sigar_proc_modules + It is possible for the latter to hang on win2k, the former also + works on NT. + + * Implement sigar_net_connection_list for AIX and HPUX + + * Convert Cpu times to seconds + +2005-05-10 Doug MacEachern + + * 1.1.19 released + +2005-04-27 Doug MacEachern + + * Add disk i/o metrics for Windows 2000 + + * Add file_system_usage_t.used field + +2005-04-06 Doug MacEachern + + * Add new disk i/o metrics (disk_write_bytes, disk_read_bytes, + disk_queue) for Win32, Linux, Solaris, AIX and HPUX. + +2005-03-19 Doug MacEachern + + * Add udp support to sigar_proc_port_get win32 impl + + * Implement sigar_proc_port_get for FreeBSD 5.x + +2005-03-15 Doug MacEachern + + * Change Sigar.getMountedFileSystemUsage to throw + NfsUnreachableException if FileSystem is Nfs and nfs ping fails + + * Implement sigar_net_connection for FreeBSD + + * Implement sigar_proc_port_get for AIX + +2005-03-11 Doug MacEachern + + * Add sigar.NetStat class + + * Add sigar_net_connection_t.state field + + * Add sigar_net_connection_t.{send,receive}_queue fields + + * Implement sigar_net_connection for solaris + + * Netstat enhancements + +2005-03-09 Doug MacEachern + + * Add CpuTimer class, helper around ThreadCpu class + +2005-03-01 Doug MacEachern + + * 1.1.18 released + + * fix bug in ptql args glob substring operators (Args.*.{sw,ew,ct}) + + * fix bug where Pentium III was reported as II + + * added OperatingSystem class to help determine linux + vendor/version info, etc. + +2005-02-24 Doug MacEachern + + * 1.1.17 released + + * Optimize aix disk i/o metric collection + + * Add 'time' command to the shell + +2005-02-23 Doug MacEachern + + * 1.1.16 released + + * Add function to get data seen in the 'who' command + +2005-02-20 Doug MacEachern + + * Add NfsFileSystem class w/ ping method + +2005-02-16 Doug MacEachern + + * Add FreeBSD support + + * Add 64-bit linux support + +2005-01-26 Doug MacEachern + + * 1.1.15 released + + * fix windows 2003 problem with metrics that use the perfdata + registry interface when pdh.dll functions are used by the same + process. + + * Pdh.getSingleValue now uses PdhGetRawCounterValue underneath + + * fix win32.Pdh.close method + + * fix win32.Service.finalize method + +2005-01-07 Doug MacEachern + + * implement thread-cpu metrics for aix + +2005-01-06 Doug MacEachern + + * 1.1.14 released + + * fix solaris bug w/ multiple network interfaces that have the + same name (hme0, hme1, etc) + + * fix bug in MultiProc that sometimes resulted in negative numbers + + * add win32.Service.getServiceNames method + +2004-12-11 Doug MacEachern + + * 1.1.13 released + +2004-12-06 Doug MacEachern + + * add iostat shell command + + * implement disk io metrics for aix, solaris and hpux + +2004-12-05 Doug MacEachern + + * added sigar_file_system_usage_t.disk_{reads,writes} fields. + implement only on linux and win32 for the moment. + +2004-11-29 Doug MacEachern + + * fix possible segfault in sigar_group_name_get if gid == -1 + +2004-11-22 Doug MacEachern + + * fix bug in RegistryKey.openSubKey under WebSphere 4.0 jdk + +2004-11-21 Doug MacEachern + + * 1.1.11 released + + * merged hyperic win32bindings package into sigar.win32 + + * added sigar_cpu_t.wait metric + +2004-11-19 Doug MacEachern + + * added sigar_mem_t.actual_{used,free} fields. + on linux for example adjusts -/+ buffers/cache + +2004-11-17 Doug MacEachern + + * added sigar_thread_cpu_t, per-thread cpu metrics + +2004-11-16 Doug MacEachern + + * 1.1.10 released + +2004-11-12 John Sachs + + * added sysinfo shell command + +2004-11-10 Doug MacEachern + + * added MultiProcCpu and MultiProcMem classes + + * added mps (multi-process ps) shell command + +2004-11-02 Doug MacEachern + + * fix cpu idle metric for windows 2000 and NT versions + +2004-10-05 Doug MacEachern + + * make sigar_swap and sigar_mem compatible with linux 2.6 kernel + +2004-09-07 Doug MacEachern + + * starting ChangeLog for version 1.1.10 + diff --git a/lib/sigar_LICENSE b/lib/sigar_LICENSE new file mode 100644 index 0000000..11069ed --- /dev/null +++ b/lib/sigar_LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/lib/sigar_NOTICE b/lib/sigar_NOTICE new file mode 100644 index 0000000..5c3ccaa --- /dev/null +++ b/lib/sigar_NOTICE @@ -0,0 +1,35 @@ +Hyperic SIGAR includes some third-party open source components +in its distribution. The list below identifies the community or +organization and links to their appropriate license terms. + +The Hyperic team would like to thank all the communities +of the projects listed below for their contributions. +--------------------------------------------------------------------- + +The following components are included without modification: + +- log4j - +Information: http://logging.apache.org/ +License: http://www.apache.org/licenses/LICENSE-2.0 + +The following components are included with modification: + +- cpptasks - +Information: http://ant-contrib.sourceforge.net/ +License: http://ant-contrib.sourceforge.net/LICENSE.txt + +- (portions of) APR - +Information: http://apr.apache.org/ +License: http://www.apache.org/licenses/LICENSE-2.0 + +- solaris get_mib2 - +Information: ftp://vic.cc.purdue.edu/pub/tools/unix/solaris/get_mib2/ +License: within src/os/solaris/get_mib2.[ch] + +- getline by Chris Thewalt - +Information: http://tinyurl.com/r438r +License: within src/sigar_getline.c + +- PrintfFormat.java - +Information: http://java.sun.com/developer/technicalArticles/Programming/sprintf/PrintfFormat.java +License: within bindings/java/src/org/hyperic/sigar/util/PrintfFormat.java diff --git a/lib/sigar_README b/lib/sigar_README new file mode 100644 index 0000000..ccbf285 --- /dev/null +++ b/lib/sigar_README @@ -0,0 +1,2 @@ +Visit the SIGAR Wiki for documentation, bugs, support, etc.: +http://sigar.hyperic.com/ diff --git a/lib/sigar_javadoc.zip b/lib/sigar_javadoc.zip new file mode 100644 index 0000000..f415f28 Binary files /dev/null and b/lib/sigar_javadoc.zip differ diff --git a/resources/WebContent/index.tmpl b/resources/WebContent/index.tmpl index 8b31bb9..8acc886 100644 --- a/resources/WebContent/index.tmpl +++ b/resources/WebContent/index.tmpl @@ -14,6 +14,7 @@ + diff --git a/resources/WebContent/js/Chart.min.js b/resources/WebContent/js/Chart.min.js new file mode 100644 index 0000000..3a0a2c8 --- /dev/null +++ b/resources/WebContent/js/Chart.min.js @@ -0,0 +1,11 @@ +/*! + * Chart.js + * http://chartjs.org/ + * Version: 1.0.2 + * + * Copyright 2015 Nick Downie + * Released under the MIT license + * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md + */ +(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),st?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),tthis.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;ip&&(p=t.x+s,n=i),t.x-sp&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'
    <% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<% for (var i=0; i
  • <%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)0&&ithis.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.ythis.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'
      <% for (var i=0; i
    • <%if(segments[i].label){%><%=segments[i].label%><%}%>
    • <%}%>
    '};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this); \ No newline at end of file diff --git a/src/wa/server/page/StatusPage.java b/src/wa/server/page/StatusPage.java index b397819..3ddbfa7 100644 --- a/src/wa/server/page/StatusPage.java +++ b/src/wa/server/page/StatusPage.java @@ -70,7 +70,7 @@ public class StatusPage extends AbstractPage{ if(request.containsKey("i")) { WAStatus obj = getPlugin(Integer.parseInt(request.get("i"))); DataNode root = new DataNode(DataNode.DataType.Map); - obj.jsonUpdate(root); + obj.jsonUpdate(request, root); return root; } return null; diff --git a/src/wa/server/plugin/WAStatus.java b/src/wa/server/plugin/WAStatus.java index 6100eab..bb4ca71 100644 --- a/src/wa/server/plugin/WAStatus.java +++ b/src/wa/server/plugin/WAStatus.java @@ -24,6 +24,8 @@ package wa.server.plugin; import zutil.parser.DataNode; +import java.util.Map; + /** * Created by Ziver on 2015-04-06. */ @@ -33,5 +35,5 @@ public interface WAStatus { public String html(); - public void jsonUpdate(DataNode root); + public void jsonUpdate(Map request, DataNode root); } diff --git a/src/wa/server/plugin/hwstatus/CpuStatus.java b/src/wa/server/plugin/hwstatus/CpuStatus.java deleted file mode 100644 index e07290a..0000000 --- a/src/wa/server/plugin/hwstatus/CpuStatus.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2015 Ziver - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package wa.server.plugin.hwstatus; - -import org.hyperic.sigar.CpuInfo; -import org.hyperic.sigar.CpuPerc; -import org.hyperic.sigar.Sigar; -import org.hyperic.sigar.SigarException; -import org.hyperic.sigar.cmd.Shell; -import wa.server.plugin.WAStatus; -import zutil.io.file.FileUtil; -import zutil.parser.DataNode; - -import java.io.IOException; -import java.text.DecimalFormat; - -/** - * Created by Ziver on 2015-04-07. - */ -public class CpuStatus implements WAStatus { - @Override - public String getName() { - return "Cpu Load"; - } - - @Override - public String html() { - try { - return FileUtil.getContent(FileUtil.findURL("wa/server/plugin/hwstatus/CpuStatus.tmpl")); - } catch (IOException e) { - return e.getMessage(); - } - } - - @Override - public void jsonUpdate(DataNode root) { - DataNode cpuNode = new DataNode(DataNode.DataType.List); - - try{ - Sigar sigar = new Shell().getSigar(); - CpuInfo cpu_info = sigar.getCpuInfoList()[0]; - for(CpuPerc cpu : sigar.getCpuPercList()){ - cpuNode.add(Math.round(cpu.getCombined() * 100.0) / 100.0 ); - } - - } catch (SigarException e) { - e.printStackTrace(); - } - - root.set("cpu", cpuNode); - } -} diff --git a/src/wa/server/plugin/hwstatus/CpuStatus.tmpl b/src/wa/server/plugin/hwstatus/CpuStatus.tmpl deleted file mode 100644 index 327ba0b..0000000 --- a/src/wa/server/plugin/hwstatus/CpuStatus.tmpl +++ /dev/null @@ -1,98 +0,0 @@ -
    -
    Cpu Status
    -
    -
    -
    -
    -
    -
    Memory
    -
    -
    -
    -
    -
    -
    Process List
    -
    -
    -
    -
    -
    -
    - - diff --git a/src/wa/server/plugin/hwstatus/HwStatus.java b/src/wa/server/plugin/hwstatus/HwStatus.java new file mode 100644 index 0000000..44279fd --- /dev/null +++ b/src/wa/server/plugin/hwstatus/HwStatus.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2015 Ziver + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package wa.server.plugin.hwstatus; + +import org.hyperic.sigar.*; +import org.hyperic.sigar.cmd.Shell; +import wa.server.plugin.WAStatus; +import zutil.io.file.FileUtil; +import zutil.parser.DataNode; +import zutil.parser.DataNode.DataType; + +import java.io.IOException; +import java.util.Map; + +/** + * Created by Ziver on 2015-04-07. + */ +public class HwStatus implements WAStatus { + @Override + public String getName() { + return "Cpu Load"; + } + + @Override + public String html() { + try { + return FileUtil.getContent(FileUtil.findURL("wa/server/plugin/hwstatus/HwStatus.tmpl")); + } catch (IOException e) { + return e.getMessage(); + } + } + + @Override + public void jsonUpdate(Map request, DataNode root) { + try{ + Sigar sigar = new Shell().getSigar(); + + if(request.containsKey("cpu")) { + DataNode cpuNode = new DataNode(DataType.List); + CpuInfo cpu_info = sigar.getCpuInfoList()[0]; + for (CpuPerc cpu : sigar.getCpuPercList()) { + cpuNode.add(Math.round(cpu.getCombined() * 100.0) / 100.0); + } + root.set("cpu", cpuNode); + } + if(request.containsKey("memory")) { + DataNode memNode = new DataNode(DataType.Map); + Mem mem = sigar.getMem(); + memNode.set("free", sizeByteToMB(mem.getFree())); + memNode.set("used", sizeByteToMB(mem.getUsed())); + root.set("memory", memNode); + + DataNode swapNode = new DataNode(DataType.Map); + Swap swap = sigar.getSwap(); + swapNode.set("free", sizeByteToMB(swap.getFree())); + swapNode.set("used", sizeByteToMB(swap.getUsed())); + root.set("swap", swapNode); + } + if(request.containsKey("proc")) { + DataNode procListNode = new DataNode(DataType.List); + + long[] pids = sigar.getProcList(); + //long[] pids = Shell.getPids(sigar, new String[0]); + for( long pid : pids ) { + DataNode procNode = new DataNode(DataType.Map); + + procNode.set("pid", pid); + + procNode.set("mem", sizeByteToMB(sigar.getProcMem(pid).getSize())); + try { + procNode.set("user", sigar.getProcCredName(pid).getUser()); + procNode.set("cputime", sigar.getProcTime(pid).getTotal() / 1000); + ProcCpu cpu = sigar.getProcCpu(pid); + procNode.set("cpu", CpuPerc.format(cpu.getPercent())); + }catch(Exception e){} + procNode.set("cmd", ProcUtil.getDescription(sigar, pid) ); + + procListNode.add(procNode); + } + root.set("proc", procListNode); + } + } catch (SigarException e) { + e.printStackTrace(); + } + } + + /** + * Takes in a size of B and returns MB + */ + private static long sizeByteToMB(long size){ + return size/(1024*1024); + } +} diff --git a/src/wa/server/plugin/hwstatus/HwStatus.tmpl b/src/wa/server/plugin/hwstatus/HwStatus.tmpl new file mode 100644 index 0000000..52e0889 --- /dev/null +++ b/src/wa/server/plugin/hwstatus/HwStatus.tmpl @@ -0,0 +1,125 @@ +
    +
    Cpu Status
    +
    +
    +
    +
    +
    +
    Memory
    +
    +
    +
    + + + + +
    UsedFree
    Memory5555
    Swap5555
    +
    +
    +
    +
    Process List
    +
    + + + + + + + + + + + +
    PIDUserCPUCpuTimeMemory(MB)Proc
    +
    +
    + + diff --git a/src/wa/server/plugin/hwstatus/plugin.json b/src/wa/server/plugin/hwstatus/plugin.json index 960a0ed..b256323 100644 --- a/src/wa/server/plugin/hwstatus/plugin.json +++ b/src/wa/server/plugin/hwstatus/plugin.json @@ -2,8 +2,7 @@ "version": "1.0", "name": "HW Status", "interfaces": [ - {"wa.server.plugin.WAStatus": "wa.server.plugin.hwstatus.CpuStatus"}, - {"wa.server.plugin.WAStatus": "wa.server.plugin.hwstatus.MemStatus"}, + {"wa.server.plugin.WAStatus": "wa.server.plugin.hwstatus.HwStatus"}, {"wa.server.plugin.WAStatus": "wa.server.plugin.hwstatus.HDDStatus"}, {"wa.server.plugin.WAStatus": "wa.server.plugin.hwstatus.NetStatus"} ]