Skip to content

Commit

Permalink
fix: fix small bug in timing logic (#2099)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamilton723 authored Oct 18, 2023
1 parent 83e199a commit 2abfbda
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ trait SynapseMLLogging extends Logging {
}

def logFit[T](f: => T, columns: Int, logCertifiedEvent: Boolean = true): T = {
logVerb("fit", f, columns, logCertifiedEvent)
logVerb("fit", f, Some(columns), logCertifiedEvent)
}

def logTransform[T](f: => T, columns: Int, logCertifiedEvent: Boolean = true): T = {
logVerb("transform", f, columns, logCertifiedEvent)
logVerb("transform", f, Some(columns), logCertifiedEvent)
}

def logVerb[T](verb: String, f: => T, columns: Int = -1, logCertifiedEvent: Boolean = false): T = {
def logVerb[T](verb: String, f: => T, columns: Option[Int] = None, logCertifiedEvent: Boolean = false): T = {
val startTime = System.nanoTime()
try {
// Begin emitting certified event.
logBase(verb, Some(columns), Some((System.nanoTime() - startTime) / 1e9), logCertifiedEvent)
f
val ret = f
logBase(verb, columns, Some((System.nanoTime() - startTime) / 1e9), logCertifiedEvent)
ret
} catch {
case e: Exception =>
logErrorBase(verb, e)
Expand Down

0 comments on commit 2abfbda

Please sign in to comment.