Sometimes users want to analyze GC logs for a certain time interval instead of analyzing the entire GC Log. Here are the use cases for it:

a. If GC logs are not configured to roll over (which is typically the case in most organizations), one single
GC log file will end up having the information of all GC events. Certain applications would have been
started days/weeks back. Thus, one single GC log file would end up having all those days/weeks’ worth of
GC events. The user might want to analyze only for last 24 hours’ worth of GC activities.
b.Each application will have high traffic volume and low traffic volume time in a day. User might want to
analyze the GC only during peak volume time periods. Say, if the user is from the financial industry, and
he wants to monitor GC activities only during COW (Critical Online Window) i.e. 9:00am to 6:00pm.

To facilitate such time-based processing, we have provided 4 filtering options in GCeasy API. You are
welcome to use the option that best works for you.

Time Filter Options

In this section let’s review the Time filter options.

As it’s always said, the best way to learn is through example. Let’s take this hypothetical example: This GC log file has only 5 GC events. Below are the timestamps of the 5 GC events.

Event 1 Timestamp: 2017-12-25T10:01:00.000-0700

Event 2 Timestamp: 2017-12-25T10:02:00.000-0700

Event 3 Timestamp: 2017-12-25T10:03:00.000-0700

Event 4 Timestamp: 2017-12-25T10:04:00.000-0700

Event 5 Timestamp: 2017-12-25T10:05:00.000-0700

First event ran at 2017-12-25T10:01:00.000-0700. Fifth (i.e. last) event ran at 2017-12-25T10:05:00.000-0700. There is 1-minute interval between each GC event.

#1. startTime

Using this option, you can filter GC logs from a starting timestamp. All GC events that occurred earlier to this timestamp will be ignored. Let’s say you invoke the GCeasy API with ‘startTime’ to be 2017-12-25T10:03:00.000-0700 (i.e. event #3); then, GCeasy API will only parse events #4 and #5 . Events #1, #2 and #3 will be ignored.

You can invoke this option by passing ‘startTime’ in the HTTP URL.

Syntax:

http://gceasy.io/analyzeGC?apiKey=<API-KEY>&startTime=<yyyy-MM-dd'T'HH:mm:ss.SSSZ>

Example:

http://gceasy.io/analyzeGC?apiKey=e094a34e-c3eb-4c9a-8254-f0de107135dc&startTime=2017-12-25T10%3A03%3A00.000-0700

Note: When you pass the timestamp in the HTTP URL, it needs to be encoded. Encoded format of 2017-12-25T10:03:00.000-0700 is 2017-12-25T10%3A03%3A00.000-0700


#2. endTime

Using this option, you can filter GC logs till an ending timeStamp. All GC events that occured after this timestamp will be ignored. Let’s say, you invoke the GCeasy API with ‘endTime’ to be 2017-12-25T10:03:00.000-0700 (i.e. event #3), then GCeasy API will only parse events #1 and #2. Events #3, #4 and #5 will be ignored.

You can invoke this option, by passing ‘endTime’ in the HTTP URL.

Syntax:

 http://gceasy.io/analyzeGC?apiKey=<API-KEY>&endTime=<yyyy-MM-dd'T'HH:mm:ss.SSSZ>

Example:

http://gceasy.io/analyzeGC?apiKey=e094a34e-c3eb-4c9a-8254-f0de107135dc&endTime=2017-12-25T10%3A03%3A00.000-0700

#3. startTime and endTime

Using this option, you can filter GC logs from a starting timestamp to an ending timestamp. All GC events that occurred earlier to and after these timestamps will be ignored. Let’s say, you invoke the GCeasy API with ‘startTime’ to be 2017-12-25T10:02:00.000-0700 (i.e. event #2) and ‘endTime’ to be 2017-12-25T10:04:00.000-0700 (i.e. event #4), then GCeasy API will only parse event #3. Events #1, #2, #4, #5 will be ignored.

Syntax:

http://gceasy.io/analyzeGC?apiKey=<API-KEY>&startTime=<yyyy-MM-dd'T'HH:mm:ss.SSSZ>&endTime=<yyyy-MM-dd'T'HH:mm:ss.SSSZ>

Example:

http://gceasy.io/analyzeGC?apiKey=e094a34e-c3eb-4c9a-8254-f0de107135dc&startTime=2017-12-25T10%3A02%3A00.000-0700&endTime=2017-12-25T10%3A04%3A00.000-0700

#4. beforeEndTime

Using this option, you can filter GC logs for a specific time period before the end of the GC log file. Let’s say you invoke the GCeasy API with ‘beforeEndTime’ to be ‘2min’ then GCeasy API will only parse events #4 and #5. Events #1, #2, #3 will be ignored because they occurred 2 minutes before the end of the GC log file.

Syntax:

 http://gceasy.io/analyzeGC?apiKey=<API-KEY>&beforeEndTime=<TIME-PERIOD>

Here are the allowed values for the TIME-PERIOD:

ms
sec
min
hr
day

Example:

 http://gceasy.io/analyzeGC?apiKey=<API-KEY>&beforeEndTime=2min

Reference Link: https://blog.gceasy.io/2018/01/04/gc...-time-filters/