當前位置: 首頁>>代碼示例>>Java>>正文


Java Iterables類代碼示例

本文整理匯總了Java中org.springframework.boot.actuate.metrics.Iterables的典型用法代碼示例。如果您正苦於以下問題:Java Iterables類的具體用法?Java Iterables怎麽用?Java Iterables使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Iterables類屬於org.springframework.boot.actuate.metrics包,在下文中一共展示了Iterables類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setAndGet

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void setAndGet() {
	this.repository.set("foo",
			Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 12.3)));
	this.repository.set("foo",
			Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 15.3)));
	assertThat(Iterables.collection(this.repository.findAll("foo")).iterator().next()
			.getValue()).isEqualTo(15.3);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RedisMultiMetricRepositoryTests.java

示例2: setAndGetMultiple

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void setAndGetMultiple() {
	this.repository.set("foo",
			Arrays.<Metric<?>>asList(new Metric<Number>("foo.val", 12.3),
					new Metric<Number>("foo.bar", 11.3)));
	assertThat(Iterables.collection(this.repository.findAll("foo"))).hasSize(2);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:8,代碼來源:RedisMultiMetricRepositoryTests.java

示例3: prefixedMetricsCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void prefixedMetricsCopied() {
	this.reader.set(new Metric<Number>("foo.bar", 2.3));
	this.reader.set(new Metric<Number>("foo.spam", 1.3));
	this.exporter.setGroups(Collections.singleton("foo"));
	this.exporter.export();
	assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:PrefixMetricGroupExporterTests.java

示例4: unprefixedMetricsNotCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void unprefixedMetricsNotCopied() {
	this.reader.set(new Metric<Number>("foo.bar", 2.3));
	this.reader.set(new Metric<Number>("foo.spam", 1.3));
	this.exporter.setGroups(Collections.singleton("bar"));
	this.exporter.export();
	assertThat(Iterables.collection(this.writer.groups())).isEmpty();
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:PrefixMetricGroupExporterTests.java

示例5: multiMetricGroupsCopiedAsDefault

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void multiMetricGroupsCopiedAsDefault() {
	this.reader.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("bar", 2.3),
			new Metric<Number>("spam", 1.3)));
	this.exporter.export();
	assertThat(this.writer.countGroups()).isEqualTo(1);
	assertThat(Iterables.collection(this.writer.findAll("foo"))).hasSize(2);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:PrefixMetricGroupExporterTests.java

示例6: onlyPrefixedMetricsCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void onlyPrefixedMetricsCopied() {
	this.reader.set(new Metric<Number>("foo.bar", 2.3));
	this.reader.set(new Metric<Number>("foo.spam", 1.3));
	this.reader.set(new Metric<Number>("foobar.spam", 1.3));
	this.exporter.setGroups(Collections.singleton("foo"));
	this.exporter.export();
	assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:PrefixMetricGroupExporterTests.java

示例7: setAndGet

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void setAndGet() {
	this.repository.set("foo",
			Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 12.3)));
	this.repository.set("foo",
			Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 15.3)));
	assertEquals(15.3, Iterables.collection(this.repository.findAll("foo")).iterator()
			.next().getValue());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:10,代碼來源:RedisMultiMetricRepositoryTests.java

示例8: setAndGetMultiple

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void setAndGetMultiple() {
	this.repository.set("foo",
			Arrays.<Metric<?>>asList(new Metric<Number>("foo.val", 12.3),
					new Metric<Number>("foo.bar", 11.3)));
	assertEquals(2, Iterables.collection(this.repository.findAll("foo")).size());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:8,代碼來源:RedisMultiMetricRepositoryTests.java

示例9: prefixedMetricsCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void prefixedMetricsCopied() {
	this.reader.set(new Metric<Number>("foo.bar", 2.3));
	this.reader.set(new Metric<Number>("foo.spam", 1.3));
	this.exporter.setGroups(Collections.singleton("foo"));
	this.exporter.export();
	assertEquals(1, Iterables.collection(this.writer.groups()).size());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:9,代碼來源:PrefixMetricGroupExporterTests.java

示例10: unprefixedMetricsNotCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void unprefixedMetricsNotCopied() {
	this.reader.set(new Metric<Number>("foo.bar", 2.3));
	this.reader.set(new Metric<Number>("foo.spam", 1.3));
	this.exporter.setGroups(Collections.singleton("bar"));
	this.exporter.export();
	assertEquals(0, Iterables.collection(this.writer.groups()).size());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:9,代碼來源:PrefixMetricGroupExporterTests.java

示例11: multiMetricGroupsCopiedAsDefault

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void multiMetricGroupsCopiedAsDefault() {
	this.reader.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("bar", 2.3),
			new Metric<Number>("spam", 1.3)));
	this.exporter.export();
	assertEquals(1, this.writer.countGroups());
	assertEquals(2, Iterables.collection(this.writer.findAll("foo")).size());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:9,代碼來源:PrefixMetricGroupExporterTests.java

示例12: onlyPrefixedMetricsCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void onlyPrefixedMetricsCopied() {
	this.reader.set(new Metric<Number>("foo.bar", 2.3));
	this.reader.set(new Metric<Number>("foo.spam", 1.3));
	this.reader.set(new Metric<Number>("foobar.spam", 1.3));
	this.exporter.setGroups(Collections.singleton("foo"));
	this.exporter.export();
	assertEquals(1, Iterables.collection(this.writer.groups()).size());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:10,代碼來源:PrefixMetricGroupExporterTests.java

示例13: findAll

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void findAll() {
	this.repository.increment(new Delta<Long>("foo", 3L));
	this.repository.set(new Metric<Number>("bar", 12.3));
	assertThat(Iterables.collection(this.repository.findAll())).hasSize(2);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:7,代碼來源:RedisMetricRepositoryTests.java

示例14: prefixedMetricsCopied

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void prefixedMetricsCopied() {
	this.reader.set(new Metric<Number>("foo", 2.3));
	this.exporter.export();
	assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:7,代碼來源:RichGaugeExporterTests.java

示例15: findAll

import org.springframework.boot.actuate.metrics.Iterables; //導入依賴的package包/類
@Test
public void findAll() {
	this.repository.increment(new Delta<Long>("foo", 3L));
	this.repository.set(new Metric<Number>("bar", 12.3));
	assertEquals(2, Iterables.collection(this.repository.findAll()).size());
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:7,代碼來源:RedisMetricRepositoryTests.java


注:本文中的org.springframework.boot.actuate.metrics.Iterables類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。