From 3d8f5da2077327e313cb958b4a0d1a01f9af8c2c Mon Sep 17 00:00:00 2001 From: Evgenii Slutckii Date: Tue, 3 Dec 2024 18:10:10 +0000 Subject: [PATCH] adding timestamps to troubleshoot scoot - 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 --- .../main/scala/com/twitter/scrooge/Compiler.scala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scrooge-generator/src/main/scala/com/twitter/scrooge/Compiler.scala b/scrooge-generator/src/main/scala/com/twitter/scrooge/Compiler.scala index fbf89a4e..a9553cc8 100644 --- a/scrooge-generator/src/main/scala/com/twitter/scrooge/Compiler.scala +++ b/scrooge-generator/src/main/scala/com/twitter/scrooge/Compiler.scala @@ -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 { @@ -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. @@ -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( @@ -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") }