-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* log-exporter: export action and event in parquet format
Signed-off-by: neo <1100909+neowu@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
50 additions
and
40 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
37 changes: 37 additions & 0 deletions
37
ext/log-exporter/src/test/java/core/log/ActionLogMessageFactory.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,37 @@ | ||
package core.log; | ||
|
||
import core.framework.log.message.ActionLogMessage; | ||
import core.framework.log.message.PerformanceStatMessage; | ||
|
||
import java.time.Instant; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ActionLogMessageFactory { | ||
public static ActionLogMessage create() { | ||
var message = new ActionLogMessage(); | ||
message.date = Instant.parse("2022-11-07T00:00:00Z"); | ||
message.id = "id"; | ||
message.app = "app"; | ||
message.action = "action"; | ||
message.result = "OK"; | ||
message.host = "host"; | ||
message.elapsed = 1000L; | ||
List<String> keys = new ArrayList<>(); | ||
keys.add(null); | ||
message.context = Map.of("customer_id", List.of("customer_id1", "customer_id2"), "key", keys); | ||
message.performanceStats = Map.of("kafka", perfStats(1, 1000L, 10, 5), | ||
"http", perfStats(2, 2000L, null, null)); | ||
return message; | ||
} | ||
|
||
private static PerformanceStatMessage perfStats(int count, long totalElapsed, Integer readEntries, Integer writeEntries) { | ||
final PerformanceStatMessage stats = new PerformanceStatMessage(); | ||
stats.count = count; | ||
stats.totalElapsed = totalElapsed; | ||
stats.readEntries = readEntries; | ||
stats.writeEntries = writeEntries; | ||
return stats; | ||
} | ||
} |
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