-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCToolKit#addDataSourceParser (#288)
* refactor: fix up mapping of aggregators to channels * add method GCToolkit#addDataSourceParser * Add GCToolKit#LOG_DEBUG_MESSAGE * improve debug messages * clean up formatting of debug message * s/producesEvents/eventsProduced/ --------- Co-authored-by: Kirk Pepperdine <[email protected]>
- Loading branch information
Showing
23 changed files
with
366 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
api/src/main/java/com/microsoft/gctoolkit/message/DataSourceParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package com.microsoft.gctoolkit.message; | ||
|
||
import com.microsoft.gctoolkit.aggregator.EventSource; | ||
import com.microsoft.gctoolkit.jvm.Diary; | ||
|
||
import java.util.Set; | ||
|
||
public interface DataSourceParser extends DataSourceChannelListener { | ||
void publishTo(JVMEventChannel channel); | ||
void diary(Diary diary); | ||
boolean accepts(Diary diary); | ||
Set<EventSource> eventsProduced(); | ||
} |
26 changes: 26 additions & 0 deletions
26
api/src/test/java/com/microsoft/gctoolkit/io/RotatingGCLogTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.microsoft.gctoolkit.io; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
public class RotatingGCLogTest { | ||
|
||
@Test | ||
void orderRotatingLogsTest() { | ||
Path path = new TestLogFile("G1-80-16gbps2.log").getFile().toPath(); | ||
try { | ||
RotatingGCLogFile file = new RotatingGCLogFile(path); | ||
assertEquals(2, file.getMetaData().getNumberOfFiles()); | ||
assertEquals(2, file.getMetaData().logFiles().map(LogFileSegment::getPath).map(Path::toFile).map(File::getName).filter(s -> s.startsWith("G1-80-16gbps2")).count()); | ||
file.getMetaData().logFiles().map(LogFileSegment::getEndTime).forEach(System.out::println); | ||
} catch (IOException ioe) { | ||
fail(ioe); | ||
} | ||
} | ||
} |
Oops, something went wrong.