da_top_percentile.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright [2021] JD.com, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef DA_TOP_PERCENTILE_H_
  17. #define DA_TOP_PERCENTILE_H_
  18. #include <stdint.h>
  19. struct context;
  20. struct server_pool;
  21. enum E_REPORT_TYPE { RT_MIN, RT_SHARDING, RT_ALL, RT_MAX };
  22. struct remote_param {
  23. uint64_t app_id;
  24. uint64_t interface_id;
  25. };
  26. int8_t get_host_name_info(const char *addr, char *result);
  27. int8_t set_remote_config(const char *addr, uint16_t port,
  28. struct sockaddr_in *remote_addr);
  29. int8_t set_remote_param(uint64_t app_id, uint64_t interface_id,
  30. enum E_REPORT_TYPE type, struct remote_param *pParam);
  31. int set_remote_fd();
  32. void top_percentile_report(struct context *ctx, struct server_pool *pool,
  33. int64_t elaspe, int32_t status,
  34. enum E_REPORT_TYPE type);
  35. #endif