Mode.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table\QueryStatsCollection;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.QueryStatsCollection.Mode</code>
  8. */
  9. class Mode
  10. {
  11. /**
  12. * Generated from protobuf enum <code>STATS_COLLECTION_UNSPECIFIED = 0;</code>
  13. */
  14. const STATS_COLLECTION_UNSPECIFIED = 0;
  15. /**
  16. * Stats collection is disabled
  17. *
  18. * Generated from protobuf enum <code>STATS_COLLECTION_NONE = 1;</code>
  19. */
  20. const STATS_COLLECTION_NONE = 1;
  21. /**
  22. * Aggregated stats of reads, updates and deletes per table
  23. *
  24. * Generated from protobuf enum <code>STATS_COLLECTION_BASIC = 2;</code>
  25. */
  26. const STATS_COLLECTION_BASIC = 2;
  27. /**
  28. * Add execution stats and plan on top of STATS_COLLECTION_BASIC
  29. *
  30. * Generated from protobuf enum <code>STATS_COLLECTION_FULL = 3;</code>
  31. */
  32. const STATS_COLLECTION_FULL = 3;
  33. /**
  34. * Detailed execution stats including stats for individual tasks and channels
  35. *
  36. * Generated from protobuf enum <code>STATS_COLLECTION_PROFILE = 4;</code>
  37. */
  38. const STATS_COLLECTION_PROFILE = 4;
  39. private static $valueToName = [
  40. self::STATS_COLLECTION_UNSPECIFIED => 'STATS_COLLECTION_UNSPECIFIED',
  41. self::STATS_COLLECTION_NONE => 'STATS_COLLECTION_NONE',
  42. self::STATS_COLLECTION_BASIC => 'STATS_COLLECTION_BASIC',
  43. self::STATS_COLLECTION_FULL => 'STATS_COLLECTION_FULL',
  44. self::STATS_COLLECTION_PROFILE => 'STATS_COLLECTION_PROFILE',
  45. ];
  46. public static function name($value)
  47. {
  48. if (!isset(self::$valueToName[$value])) {
  49. throw new UnexpectedValueException(sprintf(
  50. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  51. }
  52. return self::$valueToName[$value];
  53. }
  54. public static function value($name)
  55. {
  56. $const = __CLASS__ . '::' . strtoupper($name);
  57. if (!defined($const)) {
  58. throw new UnexpectedValueException(sprintf(
  59. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  60. }
  61. return constant($const);
  62. }
  63. }
  64. // Adding a class alias for backwards compatibility with the previous class name.
  65. class_alias(Mode::class, \Ydb\Table\QueryStatsCollection_Mode::class);