Skip to content

Commit

Permalink
Increase the time between progress updates from 500ms to 2000ms, plus…
Browse files Browse the repository at this point in the history
… make it...
  • Loading branch information
gmagnu committed Oct 14, 2024
1 parent a819ed2 commit f693f82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ class ServerGorSource(options: String, context: GorContext, executeNor: Boolean,
context,
executeNor,
context.getSession.getSystemContext.getMonitor,
500))
Integer.parseInt(System.getProperty("gor.monitor.log.interval", "2000"))))
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ object IteratorUtilities {

def getHeader(filename: String, gorRoot: String, context: GorContext): String = {
val gm: GorMonitor = null
val minLogTime = Int.MaxValue
var header = ""
context.getSession.getCache.getHeaderMap.synchronized {
Option(context.getSession.getCache.getHeaderMap.getOrDefault(filename, null)) match {
case Some(h) => header = h
case None =>
var gs:FastGorSource = null
try {
gs = new FastGorSource(filename, gorRoot, context, false, gm, minLogTime)
gs = new FastGorSource(filename, gorRoot, context, false, gm, Int.MaxValue)
header = gs.getHeader
context.getSession.getCache.getHeaderMap.put(filename, header)
} finally {
Expand Down
12 changes: 2 additions & 10 deletions model/src/main/java/org/gorpipe/gor/monitor/GorMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,14 @@ public boolean notify(String chr, int pos, String prevChr) {
* @param msg log message
*/
public void log(String msg) {
final long time = System.currentTimeMillis();
synchronized (timestampFormatter) {
String timestamp = timestampFormatter.format(new Date(time));
log.info("Log: {} {}", timestamp, msg);
}
log.info(msg);
}

/**
* @param msg debug message
*/
public void debug(String msg) {
final long time = System.currentTimeMillis();
synchronized (timestampFormatter) {
String timestamp = timestampFormatter.format(new Date(time));
log.debug("Log: {} {}", timestamp, msg);
}
log.debug(msg);
}

public void close() {}
Expand Down

0 comments on commit f693f82

Please sign in to comment.