Port queries only support 'eq'
This commit is contained in:
parent
17cfaa494a
commit
508c39b2aa
@ -100,6 +100,7 @@ public class TestPTQL extends SigarTestCase {
|
||||
"Pid.Pid.eq=foo",
|
||||
"Cpu.Percent.ge=x",
|
||||
"Port.foo.eq=8080",
|
||||
"Port.tcp.gt=8080",
|
||||
"",
|
||||
null,
|
||||
//disabled for testing w/ -Dsigar.ptql.native=true
|
||||
|
@ -856,6 +856,11 @@ static int ptql_env_match(sigar_t *sigar,
|
||||
static int ptql_branch_init_port(ptql_parse_branch_t *parsed,
|
||||
ptql_branch_t *branch)
|
||||
{
|
||||
/* only 'eq' is supported here */
|
||||
if (branch->op_name != PTQL_OP_EQ) {
|
||||
return SIGAR_PTQL_MALFORMED_QUERY;
|
||||
}
|
||||
|
||||
if (strEQ(parsed->attr, "tcp")) {
|
||||
branch->flags = SIGAR_NETCONN_TCP;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user