2007-05-19 11:40:12 +08:00
|
|
|
/*
|
2010-04-29 05:57:11 +08:00
|
|
|
* Copyright (c) 2007-2008 Hyperic, Inc.
|
2010-04-29 06:08:39 +08:00
|
|
|
* Copyright (c) 2009 SpringSource, Inc.
|
2010-04-29 05:57:11 +08:00
|
|
|
*
|
|
|
|
* 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.
|
2007-05-19 11:40:12 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SIGAR_FORMAT_H
|
|
|
|
#define SIGAR_FORMAT_H
|
|
|
|
|
2008-03-12 14:20:43 +08:00
|
|
|
typedef struct {
|
|
|
|
double user;
|
|
|
|
double sys;
|
|
|
|
double nice;
|
|
|
|
double idle;
|
|
|
|
double wait;
|
2008-05-24 23:12:06 +08:00
|
|
|
double irq;
|
|
|
|
double soft_irq;
|
2008-05-29 02:14:00 +08:00
|
|
|
double stolen;
|
2008-03-12 14:20:43 +08:00
|
|
|
double combined;
|
|
|
|
} sigar_cpu_perc_t;
|
|
|
|
|
|
|
|
SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev,
|
|
|
|
sigar_cpu_t *curr,
|
|
|
|
sigar_cpu_perc_t *perc);
|
|
|
|
|
2007-05-19 11:40:12 +08:00
|
|
|
SIGAR_DECLARE(int) sigar_uptime_string(sigar_t *sigar,
|
|
|
|
sigar_uptime_t *uptime,
|
|
|
|
char *buffer,
|
|
|
|
int buflen);
|
|
|
|
|
|
|
|
SIGAR_DECLARE(char *) sigar_format_size(sigar_uint64_t size, char *buf);
|
|
|
|
|
2007-05-19 11:50:27 +08:00
|
|
|
SIGAR_DECLARE(int) sigar_net_address_equals(sigar_net_address_t *addr1,
|
|
|
|
sigar_net_address_t *addr2);
|
|
|
|
|
|
|
|
SIGAR_DECLARE(int) sigar_net_address_to_string(sigar_t *sigar,
|
|
|
|
sigar_net_address_t *address,
|
|
|
|
char *addr_str);
|
|
|
|
|
2009-07-30 07:07:09 +08:00
|
|
|
SIGAR_DECLARE(const char *)sigar_net_scope_to_string(int type);
|
2007-05-19 11:50:27 +08:00
|
|
|
|
2009-07-30 07:07:09 +08:00
|
|
|
SIGAR_DECLARE(sigar_uint32_t) sigar_net_address_hash(sigar_net_address_t *address);
|
2007-05-19 11:50:27 +08:00
|
|
|
|
2007-05-19 11:40:12 +08:00
|
|
|
SIGAR_DECLARE(const char *)sigar_net_connection_type_get(int type);
|
|
|
|
|
|
|
|
SIGAR_DECLARE(const char *)sigar_net_connection_state_get(int state);
|
|
|
|
|
2007-09-03 11:00:22 +08:00
|
|
|
SIGAR_DECLARE(char *) sigar_net_interface_flags_to_string(sigar_uint64_t flags, char *buf);
|
|
|
|
|
2007-09-17 02:32:56 +08:00
|
|
|
SIGAR_DECLARE(char *)sigar_net_services_name_get(sigar_t *sigar,
|
|
|
|
int protocol, unsigned long port);
|
|
|
|
|
2007-05-19 11:40:12 +08:00
|
|
|
#endif
|
|
|
|
|