public class ProfileUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
LOGGER
Used for logging.
|
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
convertBytesToString(long bytes)
Converts a number of bytes to a prettier format
|
static java.lang.String |
getExtractorPatternName(TrackedObject trackedObject)
Attempts to traverse up the object reference tree to determine which extractor pattern parents the given object
|
static java.lang.String |
getProbableError(ObjectMemoryProfiler profiler,
java.lang.Object rootObject)
Returns a message indicating the possible cause of excessive memory use, using a specified profiler and object
|
protected static java.lang.String |
getScrapeableFileName(TrackedObject trackedObject)
Gets the name of the scrapeable file this object is related to, or the empty string if no scrapeable file could be found
|
protected static java.lang.String |
getScrapingSessionName(TrackedObject trackedObject)
Attempts to get the name of the scraping session related to the tracked object
|
static java.lang.String |
getScriptName(TrackedObject trackedObject)
Attempts to traverse up the object reference tree to determine which script parents the given object
|
@Nullable public static java.lang.String getProbableError(@NotNull ObjectMemoryProfiler profiler, java.lang.Object rootObject)
profiler
- The profiler to use to build a profile of the object givenrootObject
- The object to profile for memory useprotected static java.lang.String getScrapingSessionName(@NotNull TrackedObject trackedObject)
trackedObject
- The object with a relation to the sessionprotected static java.lang.String getScrapeableFileName(@NotNull TrackedObject trackedObject)
trackedObject
- The object that is related to the scrapeable filepublic static java.lang.String getExtractorPatternName(@NotNull TrackedObject trackedObject)
trackedObject
- The object to get an extractor forpublic static java.lang.String getScriptName(@NotNull TrackedObject trackedObject)
trackedObject
- The object to get anscript for@NotNull protected static java.lang.String convertBytesToString(long bytes)
bytes
- The number of bytes