예제 #1
0
  def record(profileInfoPath, benchmarkPath=None, duration=None, heartbeatInterval=None,
      samplesFileSize=None, cprofile=None, profileName=None, verbose=None):
    """
    Records an xpedite profile using the supplied parameters

    :param profileInfoPath: Path to profile info module
    :type profileInfoPath: str
    :param benchmarkPath: Path to persist profile data for benchmarking
    :type benchmarkPath: str
    :param duration: Profile duration - The session is automatically terminated after elapse
                     of duration seconds (Default value = None)
    :type duration: int
    :param heartbeatInterval: Heartbeat interval for profiler's tcp connection
    :type heartbeatInterval: int
    :param samplesFileSize: Max size of data files used to store samples
    :type samplesFileSize: int
    :param cprofile: Handle to capture self profile Xpedite report generation code (Default value = None)
    :type cprofile: C{xpedite.selfProfile.CProfile}
    :param profileName: Name of the profile report
    :type profileName: str
    :param verbose: Flag to enable, verbose logging
    :type verbose: bool
    """
    if verbose:
      enableVerboseLogging()
    profileInfo = loadProfileInfo(profileInfoPath)
    validateBenchmarkPath(benchmarkPath)
    app = XpediteApp(profileInfo.appName, profileInfo.appHost, profileInfo.appInfo)
    with app:
      reportName = buildReportName(profileInfo.appName, profileName)
      report = Profiler.profile(
        app, profileInfo, reportName, benchmarkPath, False, heartbeatInterval=heartbeatInterval,
        samplesFileSize=samplesFileSize, duration=duration, cprofile=cprofile
      )
    return profileInfo, report
예제 #2
0
  def report(profileInfoPath, runId=None, dataSourcePath=None, benchmarkPath=None, cprofile=None,
      profileName=None, verbose=None):
    """
    Generates report for a previous profiling runs

    :param profileInfoPath: Path to profile info module
    :type profileInfoPath: str
    :param runId: Unique identifier for a previous run
    :type runId: str
    :param dataSourcePath: Path to load txn data for reporting
    :param benchmarkPath: Path to persist profile data for benchmarking
    :type benchmarkPath: str
    :param cprofile: Handle to capture self profile Xpedite report generation code (Default value = None)
    :type cprofile: C{xpedite.selfProfile.CProfile}
    :param profileName: Name of the profile report
    :type profileName: str
    :param verbose: Flag to enable, verbose logging
    :type verbose: bool
    """
    if verbose:
      enableVerboseLogging()
    profileInfo = loadProfileInfo(profileInfoPath)
    validateBenchmarkPath(benchmarkPath)
    app = XpediteDormantApp(profileInfo.appName, profileInfo.appHost, profileInfo.appInfo,
        runId=runId, dataSourcePath=dataSourcePath)
    with app:
      reportName = buildReportName(profileInfo.appName, profileName)
      report = Profiler.profile(app, profileInfo, reportName, benchmarkPath, True, cprofile=cprofile)
    return profileInfo, report
예제 #3
0
    def report(profileInfoPath,
               runId,
               benchmarkPath=None,
               cprofile=None,
               profileName=None,
               verbose=None,
               result=None):
        """
    Generates report for a previous profiling runs

    :param profileInfoPath: Path to profile info module
    :type profileInfoPath: str
    :param runId: Unique identifier for a previous run
    :type runId: str
    :param benchmarkPath: Path to persist profile data for benchmarking
    :type benchmarkPath: str
    :param cprofile: Handle to capture self profile Xpedite report generation code (Default value = None)
    :type cprofile: C{xpedite.selfProfile.CProfile}
    :param profileName: Name of the profile report
    :type profileName: str
    :param verbose: Flag to enable, verbose logging
    :type verbose: bool
    :param result: Object for gathering and storing profile results
    :type result: xpedite.jupyter.result.Result
    """
        if verbose:
            enableVerboseLogging()
        profileInfo = loadProfileInfo(profileInfoPath)
        validateBenchmarkPath(benchmarkPath)
        app = XpediteDormantApp(profileInfo.appName, profileInfo.appHost,
                                profileInfo.appInfo, runId)
        with app:
            from xpedite.jupyter.result import Result
            result = result if result else Result()
            reportName = buildReportName(profileInfo.appName, profileName)
            Profiler.profile(app,
                             profileInfo,
                             reportName,
                             benchmarkPath,
                             True,
                             result,
                             cprofile=cprofile)
        return profileInfo, result