ํต์ฌ๋ก
+ (void)noticeNetworkRequestForURL:(NSURL*)url httpMethod:(NSString*)httpMethod withTimer:(NRTimer*)timer responseHeaders:(NSDictionary*)headers statusCode:(NSInteger)httpStatusCode bytesSent:(NSUInteger)bytesSent bytesReceived:(NSUInteger)bytesReceived responseData:(NSData *)responseData traceHeaders:(NSDictionary<NSString*,NSString*>* _Nullable)traceHeaders andParams:(NSDictionary * _Nullable)params;
์๋ฃ๋ ํธ๋์ญ์ HTTP ๋คํธ์ํฌ ์์ฒญ์ ์๋์ผ๋ก ๊ธฐ๋กํฉ๋๋ค.
์๊ตฌ ์ฌํญ
๋ชจ๋ ์์ด์ ํธ ๋ฒ์ ๊ณผ ํธํ๋ฉ๋๋ค.
์ค๋ช
New Relic์ URL, ์๋ต ์๊ฐ, ์ํ ์ฝ๋, ์ก์์ ๋ฐ์ดํฐ๋ฅผ ์ถ์ ํฉ๋๋ค.
์๋ต ํค๋์ ์ฌ์ ์ X-NewRelic-AppData
ํค๋๊ฐ ํฌํจ๋ ๊ฒฝ์ฐ New Relic์ ๋ชจ๋ฐ์ผ ์ฑ๊ณผ ์น ์๋ฒ ๊ฐ์ ์ฐ๊ฒฐ์ ์ถ์ ํ๊ณ New Relic UI๋ ์๋ฒ ๋ ๋คํธ์ํฌ ๋ ๋๊ธฐ์ด ์๊ฐ์ ์๊ด ๊ด๊ณ ๋ฐ ๋น๊ต๋ฅผ ํ์ํฉ๋๋ค.
HTTP ์ํ ์ฝ๋๊ฐ ์ค๋ฅ(400 ์ด์)๋ฅผ ๋ํ๋ด๋ ๊ฒฝ์ฐ New Relic์ ์ด ์์ฒญ๋ ์ค๋ฅ๋ก ์ถ์ ํฉ๋๋ค. ์์ฒญ ํค๋์ ์ฌ์ ๊ณผ ์๋ต ๋ณธ๋ฌธ ๋ฐ์ดํฐ๋ New Relic UI์์ ์๋ฒ ์ค๋ฅ๋ก ์ธ์ฝ๋ฉ๋ฉ๋๋ค.
๋งค๊ฐ๋ณ์
๋งค๊ฐ๋ณ์ | ์ค๋ช |
---|---|
URL | ํ์์. ์์ฒญ์ URL์ ๋๋ค. |
๋ | ํ์์. ์์ฒญ์ HTTP ๋ฉ์๋์ ๋๋ค. |
NRTimer | ํ์์. ์์ฒญ์ ์์๊ณผ ๋์ ์บก์ฒํ๋ ํ์ด๋จธ์ ๋๋ค. |
๋๋ธ | ์ ํ ๊ณผ๋ชฉ. ์์ฒญ์ ์์ ์๊ฐ์ ์บก์ฒํ๋ double์
๋๋ค. ( |
๋๋ธ | ์ ํ ๊ณผ๋ชฉ. ์์ฒญ์ ์ข
๋ฃ ์๊ฐ์ ์บก์ฒํ๋ double์
๋๋ค. ( |
NSDictionary | ํ์์. ์๋ฒ ์๋ต์์ ๋ฐํ๋ ํค๋์ ์ฌ์ ์ ๋๋ค. |
NSUInteger | ํ์์. HTTP ์๋ต์ ์ํ ์ฝ๋์ ๋๋ค. |
NSUInteger | ํ์์. ์์ฒญ ๋ณธ๋ฌธ์์ ๋ณด๋ธ ๋ฐ์ดํธ ์์ ๋๋ค. |
NSUInteger | ํ์์. ์๋ต ๋ณธ๋ฌธ์์ ์์ ๋ ๋ฐ์ดํธ ์์ ๋๋ค. |
NSData | ํ์์. ์๋ฒ์์ ๋ฐํํ ์๋ต ๋ณธ๋ฌธ ๋ฐ์ดํฐ์ ๋๋ค. ์ถ์ ๋ ์๋ฒ ์ค๋ฅ๋ฅผ ๊ธฐ๋กํ ๋ ์ฌ์ฉ๋ฉ๋๋ค. |
NSDictionary | ๋ ์ ๋ ฅ ๊ฐ๋ฅ. ๋ถ์ฐ ์ถ์ ์ ์ฌ์ฉ๋ฉ๋๋ค. |
NSDictionary | ๋ ์ ๋ ฅ ๊ฐ๋ฅ. ๋ฏธ์ฌ์ฉ. |
์
์ค๋ธ์ ํฐ๋ธ-C
์์:
[NewRelic noticeNetworkRequestForURL:[NSURL URLWithString:@"https://www.newrelic.com"] httpMethod:@"GET" withTimer:[[NRTimer alloc] init] responseHeaders:@{} statusCode:200 bytesSent:1024 bytesReceived:52 responseData:[NSData data] traceHeaders:nil andParams:nil];
์์ ๋ฐ ์ข ๋ฃ ์๊ฐ ํฌํจ
[NewRelic noticeNetworkRequestForURL:[NSURL URLWithString:@"https://www.newrelic.com"] httpMethod:@"GET" startTime:0.0 endTime:0.1 responseHeaders:@{} statusCode:200 bytesSent:1024 bytesReceived:52 responseData:[NSData data] traceHeaders:nil andParams:nil];
๋น ๋ฅธ
์์:
NewRelic.noticeNetworkRequest(for: URL(string: "https://www.newrelic.com"), httpMethod: "GET", with: NRTimer(), responseHeaders: [:], statusCode: 200, bytesSent: 1000, bytesReceived: 1000, responseData: Data(), traceHeaders: nil, andParams: nil)
์์ ๋ฐ ์ข ๋ฃ ์๊ฐ ํฌํจ
NewRelic.noticeNetworkRequest(for: URL(string: "https://www.newrelic.com"), httpMethod: "GET", startTime: 0.0, endTime: 0.1, responseHeaders: [:], statusCode: 200, bytesSent: 1000, bytesReceived: 1000, responseData: Data(), traceHeaders: nil, andParams: nil)