fb303.thrift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * fb303.thrift
  21. */
  22. namespace java com.facebook.fb303
  23. namespace cpp facebook.fb303
  24. namespace perl Facebook.FB303
  25. /**
  26. * Common status reporting mechanism across all services
  27. */
  28. enum fb_status {
  29. DEAD = 0,
  30. STARTING = 1,
  31. ALIVE = 2,
  32. STOPPING = 3,
  33. STOPPED = 4,
  34. WARNING = 5,
  35. }
  36. /**
  37. * Standard base service
  38. */
  39. service FacebookService {
  40. /**
  41. * Returns a descriptive name of the service
  42. */
  43. string getName(),
  44. /**
  45. * Returns the version of the service
  46. */
  47. string getVersion(),
  48. /**
  49. * Gets the status of this service
  50. */
  51. fb_status getStatus(),
  52. /**
  53. * User friendly description of status, such as why the service is in
  54. * the dead or warning state, or what is being started or stopped.
  55. */
  56. string getStatusDetails(),
  57. /**
  58. * Gets the counters for this service
  59. */
  60. map<string, i64> getCounters(),
  61. /**
  62. * Gets the value of a single counter
  63. */
  64. i64 getCounter(1: string key),
  65. /**
  66. * Sets an option
  67. */
  68. void setOption(1: string key, 2: string value),
  69. /**
  70. * Gets an option
  71. */
  72. string getOption(1: string key),
  73. /**
  74. * Gets all options
  75. */
  76. map<string, string> getOptions(),
  77. /**
  78. * Returns a CPU profile over the given time interval (client and server
  79. * must agree on the profile format).
  80. */
  81. string getCpuProfile(1: i32 profileDurationInSec),
  82. /**
  83. * Returns the unix time that the server has been running since
  84. */
  85. i64 aliveSince(),
  86. /**
  87. * Tell the server to reload its configuration, reopen log files, etc
  88. */
  89. oneway void reinitialize(),
  90. /**
  91. * Suggest a shutdown to the server
  92. */
  93. oneway void shutdown(),
  94. }