Skip to content

Instantly share code, notes, and snippets.

View asgs's full-sized avatar
💭
mostly away doing nothing

A S Gowri Sankar asgs

💭
mostly away doing nothing
View GitHub Profile
@asgs
asgs / gist:6f27778bbe7bdb79eb35b503beb7fecc
Created May 4, 2019 16:30
Expected a SpanEvent with id x but was y
testFailure
testConnection[:child:8](com.navercorp.pinpoint.plugin.mongodb.MongoDBIT_2_X_IT)
java.lang.AssertionError
Expected a SpanEvent with apiId[8] but was [-23]. expected: SpanEvent(serviceType: 2651, apiId: 8, exception: null, rpc: ExpectedTraceField{expectedType=ALWAYS_TRUE, expected='null'}, endPoint: ExpectedTraceField{expectedType=EQUALS, expected='localhost:27018'}, remoteAddr: ExpectedTraceField{expectedType=ALWAYS_TRUE, expected='null'}, destinationId: ExpectedTraceField{expectedType=ALWAYS_TRUE, expected='null'}, annotations: [Collection-Info=customers, Collection-Option=secondaryPreferred, MONGO-JSON-Data=StringStringValue{stringValue1='{"name":"?"}', stringValue2='"Roy3"'}], localAsyncId: null), was: (serviceType: 2651, apiId: -23, exceptionInfo: null, rpc: null, endPoint: localhost:27018, destinationId: myMongoDbFake, [151=customers, 152=secondaryPreferred], asyncId: nullnextAsyncId: null)
com.navercorp.pinpoint.test.PluginVerifierExternalAdaptor,verifySpan,PluginVerifierExternalAdaptor.java
@asgs
asgs / gist:8da93b17ec554b8f26c9549ff509e8f0
Created April 28, 2019 20:52
NoClassDefFoundError org/bson/BsonWriter - MongoDB 2.x driver tracing error
java.lang.NoClassDefFoundError: org/bson/BsonWriter
at com.navercorp.pinpoint.plugin.mongo.MongoUtil.parseBson(MongoUtil.java:84)
at com.navercorp.pinpoint.plugin.mongo.interceptor.MongoCUDSessionInterceptor.doInAfterTrace(MongoCUDSessionInterceptor.java:70)
at com.navercorp.pinpoint.bootstrap.interceptor.SpanEventSimpleAroundInterceptorForPlugin.after(SpanEventSimpleAroundInterceptorForPlugin.java:95)
at com.navercorp.pinpoint.bootstrap.interceptor.scope.ExceptionHandleScopedInterceptor.after(ExceptionHandleScopedInterceptor.java:79)
at com.mongodb.DBCollection.insert(DBCollection.java:105)
at com.navercorp.pinpoint.plugin.mongodb.MongoDBITBase_2_X.insertData(MongoDBITBase_2_X.java:194)
at com.navercorp.pinpoint.plugin.mongodb.MongoDBITBase_2_X.testConnection(MongoDBITBase_2_X.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
@asgs
asgs / Pinpoint MongoDB 2.x Driver IT failure
Last active April 16, 2019 06:17
mvn test log for 2.x driver related IT failures
#####testRunStarted
#####testStarted#####testConnection[:child:8](com.navercorp.pinpoint.plugin.mongodb.MongoDBIT_2_X_IT)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Extract /home/gowris/.embedmongo/linux/mongodb-linux-x86_64-3.0.2.tgz START
Extract /home/gowris/.embedmongo/linux/mongodb-linux-x86_64-3.0.2.tgz DONE
[mongod output]note: noprealloc may hurt performance in many applications
[mongod output] 2019-04-16T11:42:48.931+0530 I STORAGE [DataFileSync] warning: --syncdelay 0 is not recommended and can have strange performance
[mongod output] 2019-04-16T11:42:49.046+0530 I CONTROL [initandlisten] MongoDB starting : pid=26917 port=27018 dbpath=/tmp/embedmongo-db-18ee838f-587a-4739-8034-5d0670abb172 64-bit host=prinhyltphp0301
@asgs
asgs / gist:4fa82aa2ad7d11d60264d6caedfe6ef2
Created March 26, 2019 14:54
Pinpoint annotations - Unknown compilation error
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] pinpoint ........................................... SUCCESS [ 1.141 s]
[INFO] pinpoint-annotations ............................... FAILURE [ 0.638 s]
[INFO] pinpoint-commons ................................... SKIPPED
[INFO] pinpoint-thrift .................................... SKIPPED
[INFO] pinpoint-grpc ...................................... SKIPPED
[INFO] pinpoint-bootstrap-core ............................ SKIPPED
[INFO] pinpoint-bootstrap ................................. SKIPPED
@asgs
asgs / purge-q.sh
Created November 29, 2018 21:06
Purge the given RabbitMQ Queues
#!/bin/bash
if [ $# -lt 4 ]; then
echo "At least four arguments are required. First is the hostname, 2nd and 3rd will be the RabbitMQ console username and passsword, 4th will be the queue name. If more than one queue is to be purged, pass as many additional arguments as necessary."
exit
fi
echo "Received request to Purge the Queues - ${@:4}"
for queue_name in "${@:4}"
do
echo "Attempting to purge queue '$queue_name'"
curl -u $2:$3 -s -X DELETE http://$1:15672/api/queues/%2f/$queue_name/contents -w "Status code is %{http_code}\n"
@asgs
asgs / gist:6ee48bc6242d3aa4b300e0bf049bb0c2
Created December 6, 2017 18:17
geth sigsegv sealer.go
INFO [12-06|05:06:52] Imported new state entries count=648 elapsed=42.525ms processed=1230427 pending=0 retry=0 duplicate=1526 unexpected=1591
INFO [12-06|05:06:52] Imported new block receipts count=1 elapsed=40.988ms bytes=77830 number=4682030 hash=896303…262488 ignored=0
INFO [12-06|05:06:52] Committed new head block number=4682030 hash=896303…262488
INFO [12-06|05:06:58] Imported new chain segment blocks=7 txs=751 mgas=41.746 elapsed=5.858s mgasps=7.126 number=4682037 hash=440632…bdb8df
WARN [12-06|05:06:58] Skipping deep transaction reorg depth=4682037
INFO [12-06|05:06:58] Commit new mining work number=4682038 txs=0 uncles=0 elapsed=1.445ms
unexpected fault address 0x7f200f52e888
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x7f200f52e888 pc=0x463eac]
@asgs
asgs / schema.json
Created November 21, 2017 18:14
Mongodb data validator
{
"$and" : [
{
"temp" : {
"$type" : "string"
}
},
{
"$or" : [
{
@asgs
asgs / keybase.md
Created August 1, 2017 12:42
Keybase

Keybase proof

I hereby claim:

  • I am asgs on github.
  • I am asgs (https://keybase.io/asgs) on keybase.
  • I have a public key ASDhQMRwcfHBh00P1ToW8kv-35KGu_hH2D7vCEBn_Iw39go

To claim this, I am signing this object:

@asgs
asgs / gist:62fe3cda241c0ed0cfd8a6bbf7950028
Created November 23, 2016 17:41
Get JSON and display in a table
<html>
<head>
<script type="text/javascript">
function hello() {
//
$.getJSON("https://jsonplaceholder.typicode.com/posts/", function(json) {
$('#jsonTable').css("visibility", "visible").css("border", "1px solid green");
$('#jsonTable').append("<tbody>");
for (var counter = 0; counter < json.length; counter++) {
$('#jsonTable').append("<tr><td>" + json[counter].id + "</td><td>" + json[counter].userId + "</td><td>" + json[counter].title + "</td><td>" + json[counter].body + "</td></tr>");
@asgs
asgs / gist:eb2cdeaf04dfbf00f3f7ec1d5809d27e
Last active September 26, 2016 14:23
JShell Connector
package org.asgs;
/*import org.zeroturnaround.exec.ProcessExecutor;
import org.zeroturnaround.exec.StartedProcess;
import org.zeroturnaround.exec.stream.PumpStreamHandler;*/
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
import java.util.concurrent.ExecutionException;