Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
957e3320
Commit
957e3320
authored
Jun 09, 2017
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stabilise some tests
parent
a39fe345
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
HystrixContractUtils.java
.../cloud/netflix/hystrix/contract/HystrixContractUtils.java
+7
-0
HystrixStreamTask.java
...ework/cloud/netflix/hystrix/stream/HystrixStreamTask.java
+5
-3
No files found.
spring-cloud-netflix-hystrix-contract/src/main/java/org/springframework/cloud/netflix/hystrix/contract/HystrixContractUtils.java
View file @
957e3320
...
...
@@ -50,7 +50,14 @@ public class HystrixContractUtils {
}
public
static
void
checkData
(
Map
<
String
,
Object
>
data
,
String
group
,
String
name
)
{
if
(!
data
.
get
(
"type"
).
equals
(
"HystrixCommand"
))
{
assertThat
(
data
.
get
(
"type"
)).
isEqualTo
(
"HystrixThreadPool"
);
return
;
}
assertThat
(
data
.
get
(
"type"
)).
isEqualTo
(
"HystrixCommand"
);
if
(!
data
.
get
(
"name"
).
equals
(
name
))
{
return
;
}
assertThat
(
data
.
get
(
"name"
)).
asString
().
isEqualTo
(
name
);
assertThat
(
data
.
get
(
"group"
)).
isNotNull
();
assertThat
(
data
.
get
(
"group"
)).
isEqualTo
(
group
);
...
...
spring-cloud-netflix-hystrix-stream/src/main/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTask.java
View file @
957e3320
...
...
@@ -52,7 +52,7 @@ import org.springframework.scheduling.annotation.Scheduled;
* private class MetricsPoller)
*/
public
class
HystrixStreamTask
implements
ApplicationContextAware
{
private
static
Log
log
=
LogFactory
.
getLog
(
HystrixStreamTask
.
class
);
private
MessageChannel
outboundChannel
;
...
...
@@ -68,7 +68,8 @@ public class HystrixStreamTask implements ApplicationContextAware {
private
final
JsonFactory
jsonFactory
=
new
JsonFactory
();
public
HystrixStreamTask
(
MessageChannel
outboundChannel
,
DiscoveryClient
discoveryClient
,
HystrixStreamProperties
properties
)
{
public
HystrixStreamTask
(
MessageChannel
outboundChannel
,
DiscoveryClient
discoveryClient
,
HystrixStreamProperties
properties
)
{
this
.
outboundChannel
=
outboundChannel
;
this
.
discoveryClient
=
discoveryClient
;
this
.
properties
=
properties
;
...
...
@@ -94,7 +95,8 @@ public class HystrixStreamTask implements ApplicationContextAware {
for
(
String
json
:
metrics
)
{
// TODO: batch all metrics to one message
try
{
// TODO: remove the explicit content type when s-c-stream can handle that for us
// TODO: remove the explicit content type when s-c-stream can handle
// that for us
this
.
outboundChannel
.
send
(
MessageBuilder
.
withPayload
(
json
)
.
setHeader
(
MessageHeaders
.
CONTENT_TYPE
,
this
.
properties
.
getContentType
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment