-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always create events log when profiling (#8337)
Changelog: - update: always create an event log next to the profiling file when the engine is started with the `--profiling-path` flag - remove: `--profiling-events-log-path` flag
- Loading branch information
Showing
12 changed files
with
44 additions
and
94 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
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
29 changes: 26 additions & 3 deletions
29
engine/language-server/src/main/scala/org/enso/languageserver/boot/ProfilingConfig.scala
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 |
---|---|---|
@@ -1,18 +1,41 @@ | ||
package org.enso.languageserver.boot | ||
|
||
import org.apache.commons.io.FilenameUtils | ||
|
||
import java.nio.file.Path | ||
|
||
import scala.concurrent.duration.FiniteDuration | ||
|
||
/** Application profiling configuration. | ||
* | ||
* @param runtimeEventsLogPath the path to the runtime events log file | ||
* @param profilingPath the path to the profiling output file | ||
* @param profilingTime limit the profiling duration, as an infinite profiling | ||
* duration may cause out-of-memory errors. | ||
*/ | ||
case class ProfilingConfig( | ||
runtimeEventsLogPath: Option[Path] = None, | ||
profilingPath: Option[Path] = None, | ||
profilingTime: Option[FiniteDuration] = None | ||
) | ||
) { | ||
|
||
/** Creates the path to the runtime events log with the same name as | ||
* `profilingPath` but with the `.log` extension. | ||
* | ||
* @return the path to the runtime events log file | ||
*/ | ||
def profilingEventsLogPath: Option[Path] = | ||
profilingPath.map { path => | ||
val profilingDirectory = path.getParent | ||
val profilingFileName = path.getFileName.toString | ||
val profilingFileExtension = FilenameUtils.getExtension(profilingFileName) | ||
val eventsLogFileName = | ||
profilingFileName.stripSuffix( | ||
profilingFileExtension | ||
) + ProfilingConfig.EventsLogExtension | ||
|
||
profilingDirectory.resolve(eventsLogFileName) | ||
} | ||
} | ||
object ProfilingConfig { | ||
|
||
private val EventsLogExtension = "log" | ||
} |
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
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
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
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
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