Skip to content

Commit

Permalink
adding timestamps to troubleshoot scoot
Browse files Browse the repository at this point in the history
- removing --jobs 1 for scoot that slows down CI a lot
- adding timestamps to multiple places to troubleshoot bazel execution
- removing search python client as it is not used anywhere in source and python client generation is too memory heavy, so removing it in the hope no one cares. See details: https://twitter.slack.com/archives/C88ET33MZ/p1733186503428609?thread_ts=1732760492.572859&cid=C88ET33MZ

Differential Revision: https://phabricator.twitter.biz/D1185430
  • Loading branch information
Evgenii Slutckii authored and jenkins committed Dec 3, 2024
1 parent 5ead807 commit 3d8f5da
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import com.twitter.scrooge.java_generator.ApacheJavaGenerator

import java.io.File
import java.io.FileWriter
import java.time.format.DateTimeFormatter
import java.time.LocalDateTime
import scala.collection.concurrent.TrieMap

object CompilerDefaults {
Expand All @@ -37,6 +39,8 @@ object CompilerDefaults {

class Compiler(val config: ScroogeConfig) {
var fileMapWriter: scala.Option[FileWriter] = None
// Optionally, format the timestamp if needed
val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")

def run(): Unit = {
// if --gen-file-map is specified, prepare the map file.
Expand Down Expand Up @@ -74,7 +78,10 @@ class Compiler(val config: ScroogeConfig) {
)
val doc = parser.parseFile(inputFile).mapNamespaces(config.namespaceMappings)

if (config.verbose) println("+ Compiling %s".format(inputFile))
if (config.verbose) {
val currentDateTime: LocalDateTime = LocalDateTime.now()
println("+ %s Compiling %s".format(currentDateTime.format(formatter), inputFile))
}
val resolvedDoc = TypeResolver()(doc, Some(inputFile))
val generator =
GeneratorFactory(
Expand All @@ -98,7 +105,10 @@ class Compiler(val config: ScroogeConfig) {
_.getPath
}
if (config.verbose) {
println("+ Generated %s".format(generatedFiles.mkString(", ")))
val currentDateTime: LocalDateTime = LocalDateTime.now()
println(
"+ %s Generated %s"
.format(currentDateTime.format(formatter), generatedFiles.mkString(", ")))
}
fileMapWriter.foreach { w =>
generatedFiles.foreach { path => w.write(inputFile + " -> " + path + "\n") }
Expand Down

0 comments on commit 3d8f5da

Please sign in to comment.