当前位置: 首页>>代码示例>>Java>>正文


Java Slowlog类代码示例

本文整理汇总了Java中redis.clients.util.Slowlog的典型用法代码示例。如果您正苦于以下问题:Java Slowlog类的具体用法?Java Slowlog怎么用?Java Slowlog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Slowlog类属于redis.clients.util包,在下文中一共展示了Slowlog类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: slowlog

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Test
public void slowlog() {
  // do something
  jedis.configSet("slowlog-log-slower-than", "0");
  jedis.set("foo", "bar");
  jedis.set("foo2", "bar2");

  List<Slowlog> reducedLog = jedis.slowlogGet(1);
  assertEquals(1, reducedLog.size());

  Slowlog log = reducedLog.get(0);
  assertTrue(log.getId() > 0);
  assertTrue(log.getTimeStamp() > 0);
  assertTrue(log.getExecutionTime() > 0);
  assertNotNull(log.getArgs());

  List<byte[]> breducedLog = jedis.slowlogGetBinary(1);
  assertEquals(1, breducedLog.size());

  List<Slowlog> log1 = jedis.slowlogGet();
  List<byte[]> blog1 = jedis.slowlogGetBinary();

  assertNotNull(log1);
  assertNotNull(blog1);

  long len1 = jedis.slowlogLen();

  jedis.slowlogReset();

  List<Slowlog> log2 = jedis.slowlogGet();
  List<byte[]> blog2 = jedis.slowlogGetBinary();
  long len2 = jedis.slowlogLen();

  assertTrue(len1 > len2);
  assertTrue(log1.size() > log2.size());
  assertTrue(blog1.size() > blog2.size());
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:38,代码来源:SlowlogCommandsTest.java

示例2: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override
public List<Slowlog> slowlogGet() {
  Span span = helper.buildSpan("slowlogGet");
  try {
    return super.slowlogGet();
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
开发者ID:opentracing-contrib,项目名称:java-redis-client,代码行数:13,代码来源:TracingJedis.java

示例3: countNumberOfNewSlowLogs

import redis.clients.util.Slowlog; //导入依赖的package包/类
private int countNumberOfNewSlowLogs(List<Slowlog> slowlogs) {
    int count = 0;
    if(previousTimeStamp != currentTimeStamp) {
        for (Slowlog individualLog : slowlogs) {
            Long tempTimeStamp = individualLog.getTimeStamp();
            if (tempTimeStamp > previousTimeStamp && tempTimeStamp <= currentTimeStamp) {
                count++;
            }
        }
    }
    logger.debug("The number of new slow logs between {} and {} are : {}", previousTimeStamp, currentTimeStamp, count);
    return count;
}
 
开发者ID:Appdynamics,项目名称:redis-monitoring-extension,代码行数:14,代码来源:SlowLogMetrics.java

示例4: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override
public List<Slowlog> slowlogGet() {
	client.slowlogGet();
	return Slowlog.from(client.getObjectMultiBulkReply());
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:6,代码来源:Jedis.java

示例5: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
public List<Slowlog> slowlogGet() {
  client.slowlogGet();
  return Slowlog.from(client.getObjectMultiBulkReply());
}
 
开发者ID:x7-framework,项目名称:x7,代码行数:5,代码来源:Jedis.java

示例6: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override
public List<Slowlog> slowlogGet() {

	return jedis.slowlogGet();
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:6,代码来源:Jedis.java

示例7: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override
public List<Slowlog> slowlogGet() {
    return null;
}
 
开发者ID:Inbot,项目名称:inbot-es-http-client,代码行数:5,代码来源:FakeJedis.java

示例8: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override
public List<Slowlog> slowlogGet() {
  client.slowlogGet();
  return Slowlog.from(client.getObjectMultiBulkReply());
}
 
开发者ID:sohutv,项目名称:cachecloud,代码行数:6,代码来源:Jedis.java

示例9: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override
public List<Slowlog> slowlogGet() {
    throw new UnsupportedOperationException("configGet() not implemented.");
    //return null;
}
 
开发者ID:voyages-sncf-technologies,项目名称:hesperides,代码行数:6,代码来源:JedisMock.java

示例10: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
public List<Slowlog> slowlogGet() {
client.slowlogGet();
return Slowlog.from(client.getObjectMultiBulkReply());
   }
 
开发者ID:wjw465150,项目名称:shiro-redis,代码行数:5,代码来源:Jedis.java

示例11: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Override public List<Slowlog> slowlogGet() {
    throw new FakeJedisNotImplementedException();
}
 
开发者ID:vdurmont,项目名称:fake-jedis,代码行数:4,代码来源:FakeJedis.java

示例12: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
public List<Slowlog> slowlogGet() {
	client.slowlogGet();
	return Slowlog.from(client.getObjectMultiBulkReply());
}
 
开发者ID:EdwardLee03,项目名称:jedis-sr,代码行数:5,代码来源:Jedis.java

示例13: slowogMetricsTest

import redis.clients.util.Slowlog; //导入依赖的package包/类
@Test
public void slowogMetricsTest() throws IOException {

    ArgumentCaptor<List> pathCaptor = ArgumentCaptor.forClass(List.class);
    AMonitorJob aMonitorJob = mock(AMonitorJob.class);
    MonitorConfiguration configuration = new MonitorConfiguration("Redis Monitor", "Custom Metrics|Redis", aMonitorJob);
    configuration.setConfigYml("src/test/resources/conf/config.yml");
    MetricWriteHelper metricWriteHelper = mock(MetricWriteHelper.class);
    JedisPool jedisPool = mock(JedisPool.class);
    Jedis jedis = mock(Jedis.class);
    CountDownLatch countDownLatch = new CountDownLatch(1);
    when(jedisPool.getResource()).thenReturn(jedis);
    List<Object> objectList = Lists.newArrayList();
    List list1 = new ArrayList();
    list1.add(15L);
    list1.add(1505158204L);
    list1.add(18L);
    List list11 = new ArrayList();
    list11.add("slowlog".getBytes());
    list11.add("get".getBytes());
    list1.add(list11);
    List list2 = new ArrayList();
    list2.add(14L);
    list2.add(1505158203L);
    list2.add(18L);
    List list21 = new ArrayList();
    list21.add("slowlog".getBytes());
    list21.add("get".getBytes());
    list2.add(list21);
    objectList.add(list1);
    objectList.add(list2);
    when(jedis.slowlogGet(jedis.slowlogLen())).thenReturn(Slowlog.from(objectList));
    Map<String, String> server = Maps.newHashMap();
    server.put("host", "localhost");
    server.put("port", "6379");
    server.put("name", "Server1");
    SlowLogMetrics slowLogMetrics = new SlowLogMetrics(configuration, server, metricWriteHelper, jedisPool, countDownLatch, 1505158200000L, 1505158220000L);
    slowLogMetrics.run();
    verify(metricWriteHelper).transformAndPrintMetrics(pathCaptor.capture());
    for (Metric metric : (List<Metric>)pathCaptor.getValue()){
        Assert.assertTrue(metric.getMetricPath().equals("Server|Component:AppLevels|Custom metrics|Redis|Server1|SlowLog|no_of_new_slow_logs"));
        Assert.assertTrue(metric.getMetricValue().equals("2"));
    }
}
 
开发者ID:Appdynamics,项目名称:redis-monitoring-extension,代码行数:45,代码来源:SlowLogMetricsTest.java

示例14: slowlogGet

import redis.clients.util.Slowlog; //导入依赖的package包/类
List<Slowlog> slowlogGet(); 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:2,代码来源:AdvancedJedisCommands.java


注:本文中的redis.clients.util.Slowlog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。