public final class CometUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COMET_JAVA_SDK_VERSION
The current version of the Comet Java SDK.
|
| Constructor and Description |
|---|
CometUtils() |
| Modifier and Type | Method and Description |
|---|---|
String |
createExperimentLink(String baseUrl,
String workspaceName,
String projectName,
String experimentKey)
Creates link to the experiment at Comet.
|
static Duration |
durationOrNull(Long durationMillis)
Allows safe conversion of duration in millis into
Duration. |
static String |
fullMetricName(@NonNull String name,
@NonNull ExperimentContext context)
Creates full name of the metric as it is returned by backend.
|
static String |
generateGUID()
Generates global unique identifier in format supported by Comet.ml
|
static Instant |
instantOrNull(Long timestamp)
Allows safe conversion of timestamp into
Instant. |
void |
printCometSdkVersion()
Prints the current version of the Comet Java SDK.
|
static <T> void |
putNotNull(@NonNull Map<T,String> map,
T key,
Object value)
Puts provided value into the map as string if it is not
null. |
<T> Set<T> |
setFromList(List<T> list)
Safe conversion of list to set.
|
public static final String COMET_JAVA_SDK_VERSION
public void printCometSdkVersion()
public String createExperimentLink(String baseUrl, String workspaceName, String projectName, String experimentKey)
baseUrl - the server's base URLworkspaceName - the name of the workspace.projectName - the name of projectexperimentKey - the key of the experiment.public static String generateGUID()
public static <T> void putNotNull(@NonNull
@NonNull Map<T,String> map,
@NonNull
T key,
Object value)
null.T - the type of the key.map - the container map.key - the key to use.value - the optional value.public static String fullMetricName(@NonNull @NonNull String name, @NonNull @NonNull ExperimentContext context)
name - the short name of the metriccontext - the experiment context associated with metriccontext parameter.public static Instant instantOrNull(Long timestamp)
Instant.timestamp - the time in millis since epoch or null.Instant or null if timestamp is not set.public static Duration durationOrNull(Long durationMillis)
Duration.durationMillis - the duration in millis since epoch or null.Duration or null if duration is not set.Copyright © 2022. All rights reserved.