Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef MPI_STATS_H
  8. #define MPI_STATS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // The VMPI stats module reports a bunch of statistics to a MySQL server, and the
  13. // stats can be used to trace and graph a compile session.
  14. //
  15. // Call this as soon as possible to initialize spew hooks.
  16. void VMPI_Stats_InstallSpewHook();
  17. //
  18. // pDBServerName is the hostname (or dotted IP address) of the MySQL server to connect to.
  19. // pBSPFilename is the last argument on the command line.
  20. // pMachineIP is the dotted IP address of this machine.
  21. // jobID is an 8-byte unique identifier for this job.
  22. //
  23. bool VMPI_Stats_Init_Master( const char *pHostName, const char *pDBName, const char *pUserName, const char *pBSPFilename, unsigned long *pDBJobID );
  24. bool VMPI_Stats_Init_Worker( const char *pHostName, const char *pDBName, const char *pUserName, unsigned long DBJobID );
  25. void VMPI_Stats_Term();
  26. // Add a generic text event to the database.
  27. void VMPI_Stats_AddEventText( const char *pText );
  28. class CDBInfo
  29. {
  30. public:
  31. char m_HostName[128];
  32. char m_DBName[128];
  33. char m_UserName[128];
  34. };
  35. // If you're the master, this loads pDBInfoFilename, sends that info to the workers, and
  36. // connects to the database.
  37. //
  38. // If you're a worker, this waits for the DB info, then connects to the database.
  39. void StatsDB_InitStatsDatabase(
  40. int argc,
  41. char **argv,
  42. const char *pDBInfoFilename );
  43. // The database gives back a unique ID for the job.
  44. unsigned long StatsDB_GetUniqueJobID();
  45. // Get the worker ID (used for the JobWorkerID fields in the database).
  46. unsigned long VMPI_Stats_GetJobWorkerID();
  47. #endif // MPI_STATS_H