ServiceAccessEvent.java
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.yoho.error.event;
/**
* 服务提供的restful接口访问事件
*
* Created by chunhua.zhang@yoho.cn on 2016/2/2.
*/
public class ServiceAccessEvent extends CommonEvent {
/**
* @Fields serialVersionUID
*/
private static final long serialVersionUID = 2370305262095540320L;
private final long cost;
private final long response_code;
private final String stack;
//来源于gateway的哪个接口?
private String srcService;
/**
* Create a new ApplicationEvent.
*
* @param url : 服务提供的URL
* @param cost: http服务响应时间
* @param response_code: 响应吗
* @param stack: 如果时间超过500ms,调用耗用时间堆栈
*/
public ServiceAccessEvent(String url, long cost, long response_code, String stack) {
super(url);
this.cost = cost;
this.response_code = response_code;
this.stack = stack;
}
public long getCost() {
return cost;
}
public long getResponse_code() {
return response_code;
}
public String getStack() {
return stack;
}
public void setSrcService(String srcService) {
this.srcService = srcService;
}
public String getSrcService() {
return srcService;
}
}