This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Prashant Deva | |
*/ | |
public class ConnectionDataWriter | |
{ | |
static class ConnectorHttpException extends HttpRequest.HttpRequestException | |
{ | |
ConnectorHttpException(IOException cause) | |
{ | |
super(cause); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
{ | |
private boolean stop; | |
//called by thread 1 | |
public void run() | |
{ | |
while(!stop) | |
{ | |
//do something |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var GameSocket = (function () { | |
function GameSocket() { | |
this.wsInited = false; | |
} | |
GameSocket.onDataReceive = function (msg) { | |
var data = JSON.parse(msg.body); | |
var maxHeap = data.m; | |
var user = data.d.u; | |
var usedHeap = data.d.h; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Map<Long, Long> multiDataPointsToPerTxnSummedValue(List<MultiDataPoint> countsList) | |
{ | |
Map<DateTime, Map<Long, Long>> timeStampToTxnIdToCountsMap = new HashMap<>(); | |
for (MultiDataPoint multiDataPoint : countsList) | |
{ | |
timeStampToTxnIdToCountsMap.put(multiDataPoint.getTimestamp(), convertToPerTxnData(multiDataPoint.getData())); | |
} | |
return timeStampToTxnIdToCountsMap.entrySet().stream() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Filter createFilterForAllTxns(String metricName, ObjectId appId) | |
{ | |
return new Filter() | |
.addAttribute("appid", appId.toString()) | |
.addTag(metricName); | |
} | |
Interval tempInterval = new Interval(interval.getStart(), interval.getEnd().plusSeconds(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<MultiDataPoint> convertValueResults(DruidValueResult[] results) | |
{ | |
Map<DateTime, List<DruidValueResult>> timeStampToResults = Arrays.stream(results) | |
.collect(groupingBy(r -> DateTime.parse(r.timestamp))); | |
List<MultiDataPoint> multiDataPoints = timeStampToResults.entrySet() | |
.stream() | |
.map(e -> new MultiDataPoint(e.getKey(), e.getValue().stream() | |
.collect(toMap(r -> r.event.name, r -> r.event.value)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.dripstat.billing.config.BillingConfig; | |
import net.billforward.exception.*; | |
import net.billforward.model.*; | |
import net.billforward.model.usage.Period; | |
import net.billforward.model.usage.Usage; | |
import net.billforward.model.usage.UsageSession; | |
import java.util.Date; | |
public class RealtimeUsagePriceCalculator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"schema": { | |
"dataSource": "dripstat", | |
"aggregators": [ | |
{ | |
"type": "count", | |
"name": "count" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dripstat.annotations; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
/** | |
* @author Prashant Deva | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dripstat.annotations; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
/** | |
* @author Prashant Deva | |
*/ |
OlderNewer