Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

How to get count info(cnt_sec,cnt_min,cnt_hr,cnt_day,cnt_mnt) from external hazelcast map(CounterStore.com.l7tech.external.assertions.throughputquota.ThroughputQuotaAssertion-counterStore)? #29

@wikwon69

Description

@wikwon69

Hi,

I configured a external hazelcast to store service request count info.
I mean when we configure "Apply Throughput Quota Assertion" then service request count info is stored in ssg.counters table by default as follows.

SELECT * FROM ssg.counters;

goid countername cnt_sec cnt_min cnt_hr cnt_day cnt_mnt last_update
... PRESET(bb5509b8a5621e10)- 3 3 6 6 6 1594001988640

But when I chaged the default datastore from ssgdb to externalhazelcast in /opt/SecureSpan/Gateway/node/default/etc/conf as follows;

#com.l7tech.server.extension.sharedKeyValueStoreProvider=embeddedhazelcast #com.l7tech.server.extension.sharedCounterProvider=ssgdb #com.l7tech.server.extension.sharedClusterInfoProvider=ssgdb com.l7tech.server.extension.sharedKeyValueStoreProvider=externalhazelcast com.l7tech.server.extension.sharedCounterProvider=externalhazelcast com.l7tech.server.extension.sharedClusterInfoProvider=externalhazelcast ========================================================================

Map(CounterStore.com.l7tech.external.assertions.throughputquota.ThroughputQuotaAssertion-counterStore) is created and count info seems stored in that Map.

So I make and run following program to get count info(cnt_sec,cnt_min,cnt_hr,cnt_day,cnt_mnt) from this hazelcast map.

import java.io.Serializable;
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;

public class Map_Client2 implements Serializable{

/**
 * 
 */
private static final long serialVersionUID = 1L;.........................................................................

public static void main(String[] args) throws Exception {
    
    HazelcastInstance client = HazelcastClient.newHazelcastClient();
   
    IMap<String, String> ses = client.getMap("CounterStore.com.l7tech.external.assertions.throughputquota.ThroughputQuotaAssertion-counterStore");
    
	    System.out.println("############# session size:" + ses.size());  			
		System.out.println("############# session keySet:" + ses.keySet());
		System.out.println("############# session values:" + ses.values());
		
    HazelcastClient.shutdownAll();
}

}

========================================================================

And the result data is as follows.

############# session size:1
############# session keySet:[PRESET(bb5509b8a5621e10)-]
############# session values:[[J@5fb759d6]

As you can see, session values data seems manipulated internally via gateway so it can't be analyzed directly.
So I want to know how to get counter table like data info from this map values.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions