fb303.thrift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. namespace netcore Facebook.FB303.Test
  26. /**
  27. * Common status reporting mechanism across all services
  28. */
  29. enum fb_status {
  30. DEAD = 0,
  31. STARTING = 1,
  32. ALIVE = 2,
  33. STOPPING = 3,
  34. STOPPED = 4,
  35. WARNING = 5,
  36. }
  37. /**
  38. * Standard base service
  39. */
  40. service FacebookService {
  41. /**
  42. * Returns a descriptive name of the service
  43. */
  44. string getName(),
  45. /**
  46. * Returns the version of the service
  47. */
  48. string getVersion(),
  49. /**
  50. * Gets the status of this service
  51. */
  52. fb_status getStatus(),
  53. /**
  54. * User friendly description of status, such as why the service is in
  55. * the dead or warning state, or what is being started or stopped.
  56. */
  57. string getStatusDetails(),
  58. /**
  59. * Gets the counters for this service
  60. */
  61. map<string, i64> getCounters(),
  62. /**
  63. * Gets the value of a single counter
  64. */
  65. i64 getCounter(1: string key),
  66. /**
  67. * Sets an option
  68. */
  69. void setOption(1: string key, 2: string value),
  70. /**
  71. * Gets an option
  72. */
  73. string getOption(1: string key),
  74. /**
  75. * Gets all options
  76. */
  77. map<string, string> getOptions(),
  78. /**
  79. * Returns a CPU profile over the given time interval (client and server
  80. * must agree on the profile format).
  81. */
  82. string getCpuProfile(1: i32 profileDurationInSec),
  83. /**
  84. * Returns the unix time that the server has been running since
  85. */
  86. i64 aliveSince(),
  87. /**
  88. * Tell the server to reload its configuration, reopen log files, etc
  89. */
  90. oneway void reinitialize(),
  91. /**
  92. * Suggest a shutdown to the server
  93. */
  94. oneway void shutdown(),
  95. }