Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Trace Compass » parse, check and count(parse, check and count)
parse, check and count [message #1719711] Mon, 11 January 2016 16:16 Go to next message
Hung Han is currently offline Hung HanFriend
Messages: 2
Registered: January 2016
Junior Member
Hi all,

I have a log and i want to know how many connection is "alive". My log syntax is:

2016/01/10 01:00:00 - connected: 192.168.1.1:37610
2016/01/10 01:00:05 - connected: 192.168.1.1:37611
2016/01/10 01:00:10 - connected: 192.168.1.1:37612
2016/01/10 01:00:15 - connected: 192.168.1.1:37613
2016/01/10 01:00:20 - connected: 192.168.1.1:37614
2016/01/10 01:00:30 - from: 192.168.1.1:37610 to: 192.168.1.1:37611 - content: test
2016/01/10 01:00:35 - disconnected: 192.168.1.1:37612

I want to know how can i find out that i have 4 "alived" connections?

I created a custom parse and my trace shows only "connected" and "disconnected" message. But i don't know if is it possible to use the regex result to create a rule that increment a counter if the trace don't find the "disconnected" message from that ip and port. Could aynone give me a clue? Which ss it a simplest way to do it?

Regards
Hung
Re: parse, check and count [message #1719724 is a reply to message #1719711] Mon, 11 January 2016 17:22 Go to previous messageGo to next message
Alexandre Montplaisir is currently offline Alexandre MontplaisirFriend
Messages: 4
Registered: October 2012
Junior Member
Hi,

I would suggest that your custom parser (that is, the "trace reader" part) reproduces as closely as possible what is found in your log file. That means 1 line/event per message.

What you are trying to do then fits more into the concept of "analysis", which means taking base trace events and aggregating them or constructing some sort of state machine out of it.

In your case it would be relatively simple, you could use the XML API to define a small state system that will track the number of currently ongoing connections.

You can take a look at the documentation here:
http://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/Data-driven-analysis.html#Data_driven_analysis
as well as an example here (mostly the "Step 2" in your case):
https://github.com/tracecompass/xml-analysis-example

The example in particular shows something very similar to your use case, except it tracks the state of individual connections, then builds a view for it. In your case, you could just have 1 state representing "the number of ongoing connections", then use the view "State System Explorer" to display the value at any given timestamp. This view is usually more for debugging purposes, but for very simple state systems it might be sufficient.

Hope this helps, let us know if you hit any problems.
Re: parse, check and count [message #1719864 is a reply to message #1719724] Tue, 12 January 2016 16:59 Go to previous message
Hung Han is currently offline Hung HanFriend
Messages: 2
Registered: January 2016
Junior Member
Thank you Alexandre.

I will take a look at that document you mentioned.
Previous Topic:Cannot see duration between t1 and t2 in Control Flow
Next Topic:Creating a custom text parser
Goto Forum:
  


Current Time: Thu Apr 25 16:53:38 GMT 2024

Powered by FUDForum. Page generated in 0.03502 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top