WXApmProtocol.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. #import <Foundation/Foundation.h>
  20. @protocol WXApmProtocol <NSObject>
  21. /**
  22. * start record
  23. *
  24. * @param instanceId instanceId
  25. */
  26. @required
  27. - (void) onStart:(NSString*)instanceId topic:(NSString*)topic;
  28. /**
  29. * pause apm record (apm ext mem / fps)
  30. */
  31. @required
  32. - (void) pauseApmRecord;
  33. /**
  34. * resume apm record (apm ext mem / fps)
  35. */
  36. @required
  37. - (void) resumeApmRecord;
  38. /**
  39. * end record
  40. */
  41. @required
  42. - (void) onEnd;
  43. /**
  44. * record event
  45. */
  46. @required
  47. - (void) onEvent:(NSString *)name withValue:(id)value;
  48. /**
  49. * record stage
  50. */
  51. @required
  52. - (void) onStage:(NSString *)name withValue:(long)timestamp;
  53. /**
  54. * record property
  55. */
  56. @required
  57. - (void) addProperty:(NSString *)name withValue:(id)value;
  58. /**
  59. * record statistic
  60. */
  61. @required
  62. - (void) addStatistic:(NSString *)name withValue:(double)value;
  63. @required
  64. - (void) onSubProcedureBegin:(NSString*)subProcedureName;
  65. @required
  66. - (void) onSubProcedureEndSucceed:(NSString*)subProcedureName;
  67. @required
  68. - (void) onSubProcedureEndFailed:(NSString*)subProcedureName;
  69. /**
  70. * record biz properties
  71. */
  72. @required
  73. - (void) addBiz:(NSString *)bizID withValue:(NSDictionary *)properties;
  74. /**
  75. * record biz stage
  76. */
  77. @required
  78. - (void) addBizStage:(NSString *)bizID withValue:(NSDictionary *)stage;
  79. @end
  80. @protocol WXApmGeneratorProtocol <NSObject>
  81. @required
  82. - (id<WXApmProtocol>)gengratorApmInstance:(NSString *) type;
  83. @end