process_metrics_iocounters.h 938 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This is a separate file so that users of process metrics don't need to
  5. // include windows.h unless they need IoCounters.
  6. #ifndef BASE_PROCESS_PROCESS_METRICS_IOCOUNTERS_H_
  7. #define BASE_PROCESS_PROCESS_METRICS_IOCOUNTERS_H_
  8. #include <stdint.h>
  9. #include "base/process/process_metrics.h"
  10. #include "build/build_config.h"
  11. #if defined(OS_WIN)
  12. #include <windows.h>
  13. #endif
  14. namespace base {
  15. #if defined(OS_WIN)
  16. struct IoCounters : public IO_COUNTERS {};
  17. #elif defined(OS_POSIX)
  18. struct IoCounters {
  19. uint64_t ReadOperationCount;
  20. uint64_t WriteOperationCount;
  21. uint64_t OtherOperationCount;
  22. uint64_t ReadTransferCount;
  23. uint64_t WriteTransferCount;
  24. uint64_t OtherTransferCount;
  25. };
  26. #endif
  27. } // namespace base
  28. #endif // BASE_PROCESS_PROCESS_METRICS_IOCOUNTERS_H_