├── .github ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ └── FEATURE_REQUEST.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bistoury-agent-common ├── pom.xml └── src │ ├── main │ └── java │ │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── agent │ │ └── common │ │ ├── ClosableProcess.java │ │ ├── ClosableProcesses.java │ │ ├── JavaProcesses.java │ │ ├── JavaVersionUtils.java │ │ ├── NormalProcess.java │ │ ├── ResponseHandler.java │ │ ├── UnixProcess.java │ │ ├── config │ │ └── AgentConfig.java │ │ ├── cpujstack │ │ ├── KvUtils.java │ │ └── ThreadInfo.java │ │ ├── job │ │ ├── BytesJob.java │ │ ├── ContinueResponseJob.java │ │ ├── DefaultResponseJobStore.java │ │ ├── ForwardContinueResponseJob.java │ │ └── ResponseJobStore.java │ │ ├── kv │ │ ├── DataSourceHelper.java │ │ ├── KvDb.java │ │ ├── KvDbWrapper.java │ │ ├── KvDbs.java │ │ ├── RocksDBStoreImpl.java │ │ ├── SQLiteDeleteDataGentle.java │ │ └── SQLiteStoreImpl.java │ │ ├── pid │ │ ├── Jps.java │ │ ├── PidHandler.java │ │ ├── PidHandlerFactory.java │ │ ├── PidUtils.java │ │ ├── bean │ │ │ ├── Arguments.java │ │ │ ├── JpsInfo.java │ │ │ ├── PsInfo.java │ │ │ └── Res.java │ │ └── impl │ │ │ ├── AbstractPidHandler.java │ │ │ ├── PidByJpsHandler.java │ │ │ ├── PidByPsHandler.java │ │ │ ├── PidBySystemPropertyHandler.java │ │ │ └── Priority.java │ │ ├── task │ │ └── AgentGlobalTaskFactory.java │ │ └── util │ │ ├── DateUtils.java │ │ └── Response.java │ └── test │ ├── java │ └── qunar │ │ └── tc │ │ ├── bistoury │ │ └── agent │ │ │ └── common │ │ │ └── job │ │ │ └── TestJob.java │ │ └── kv │ │ └── KVStoreTest.java │ └── resources │ └── logback.xml ├── bistoury-agent-task ├── pom.xml └── src │ ├── main │ ├── java │ │ └── qunar │ │ │ └── tc │ │ │ └── bistoury │ │ │ └── agent │ │ │ └── task │ │ │ ├── agentInfo │ │ │ ├── AgentInfoPushTaskFactory.java │ │ │ └── TaskRunner.java │ │ │ ├── cpujstack │ │ │ ├── CpuJStackTaskFactory.java │ │ │ ├── JStackPidExecutor.java │ │ │ ├── MomentCpuTimeRecordExecutor.java │ │ │ ├── PidExecutor.java │ │ │ ├── PidRecordExecutor.java │ │ │ └── TaskRunner.java │ │ │ ├── heapHisto │ │ │ ├── HeapHistoDumpTaskFactory.java │ │ │ └── TaskRunner.java │ │ │ ├── monitor │ │ │ ├── MonitorReportTaskFactory.java │ │ │ └── TaskRunner.java │ │ │ ├── proc │ │ │ ├── CpuState.java │ │ │ ├── FullState.java │ │ │ ├── ProcUtil.java │ │ │ ├── ProcessState.java │ │ │ ├── ProcessStateCalculator.java │ │ │ ├── StatParser.java │ │ │ └── ThreadState.java │ │ │ └── profiler │ │ │ ├── ProfilerFileCleanTaskFactory.java │ │ │ └── TaskRunner.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── qunar.tc.bistoury.agent.common.task.AgentGlobalTaskFactory │ └── test │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── agent │ └── task │ ├── cpujstack │ └── PidExecutorTest.java │ └── proc │ ├── InfoParserTest.java │ ├── ProcessStateCalculatorTest.java │ └── StatParserTest.java ├── bistoury-agent ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── agent │ ├── AgentClient.java │ ├── AgentGlobalTaskInitializer.java │ ├── AgentInfoRefreshTask.java │ ├── AgentNettyClient.java │ ├── Configs.java │ ├── DumpFileCleaner.java │ ├── HeartbeatTask.java │ └── ProxyConfig.java ├── bistoury-application ├── bistoury-application-api │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── application │ │ └── api │ │ ├── AdminAppService.java │ │ ├── AppServerService.java │ │ ├── AppService.java │ │ ├── ApplicationService.java │ │ └── pojo │ │ ├── AppServer.java │ │ ├── Application.java │ │ └── PermissionDenyException.java ├── bistoury-application-k8s │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── application │ │ └── k8s │ │ ├── service │ │ ├── AdminAppServiceImpl.java │ │ ├── AppServerServiceImpl.java │ │ ├── AppServiceImpl.java │ │ └── ApplicationServiceImpl.java │ │ └── util │ │ └── K8SUtils.java ├── bistoury-application-mysql │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── application │ │ └── mysql │ │ ├── dao │ │ ├── AppServerDao.java │ │ ├── ApplicationDao.java │ │ ├── ApplicationUserDao.java │ │ └── impl │ │ │ ├── AppServerDaoImpl.java │ │ │ ├── ApplicationDaoImpl.java │ │ │ └── ApplicationUserDaoImpl.java │ │ ├── service │ │ ├── AdminAppServiceImpl.java │ │ ├── AppServerServiceImpl.java │ │ ├── AppServiceImpl.java │ │ └── ApplicationServiceImpl.java │ │ └── utils │ │ └── UUIDUtil.java └── pom.xml ├── bistoury-attach-arthas ├── pom.xml └── src │ └── main │ ├── java │ ├── com │ │ └── taobao │ │ │ └── arthas │ │ │ └── core │ │ │ └── shell │ │ │ └── system │ │ │ └── impl │ │ │ ├── QGlobalJobControllerImpl.java │ │ │ ├── QJobControllerImpl.java │ │ │ └── QProcessImpl.java │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── attach │ │ └── arthas │ │ ├── agentInfo │ │ └── AgentInfoCommand.java │ │ ├── config │ │ ├── AppConfigClient.java │ │ ├── AppConfigClients.java │ │ ├── AppConfigCommand.java │ │ └── AppConfigFileCommand.java │ │ ├── debug │ │ ├── ClassInfo.java │ │ ├── DebugJsonWriter.java │ │ ├── DebugNullKeySerializer.java │ │ ├── DefaultSnapshotStore.java │ │ ├── JarDebugClient.java │ │ ├── JarDebugClients.java │ │ ├── JarDebugCommand.java │ │ ├── JarDebugPathCommand.java │ │ ├── QDebugAddCommand.java │ │ ├── QDebugClient.java │ │ ├── QDebugClients.java │ │ ├── QDebugReleaseInfoCommand.java │ │ ├── QDebugRemoveCommand.java │ │ ├── QDebugSearchCommand.java │ │ ├── RemoveListener.java │ │ ├── SizeLimitExceededException.java │ │ ├── SizeLimitedOutputStream.java │ │ ├── SnapshotCache.java │ │ └── SnapshotStore.java │ │ ├── instrument │ │ ├── DefaultClassFileBuffer.java │ │ ├── InstrumentClient.java │ │ └── InstrumentClientStore.java │ │ ├── jar │ │ ├── JarInfoClient.java │ │ ├── JarInfoClients.java │ │ └── JarInfoCommand.java │ │ ├── monitor │ │ ├── QMonitorAddCommand.java │ │ ├── QMonitorClient.java │ │ ├── QMonitorClients.java │ │ └── QMonitorSnapshotCommand.java │ │ ├── profiler │ │ ├── GProfilerClient.java │ │ ├── GProfilerClients.java │ │ ├── ProfilerInfoCommand.java │ │ ├── ProfilerStartCommand.java │ │ ├── ProfilerStateSearchCommand.java │ │ └── ProfilerStopCommand.java │ │ ├── server │ │ ├── BistouryBootstrap.java │ │ ├── QBuiltinCommandPack.java │ │ ├── QShutdownCommand.java │ │ ├── QStopCommand.java │ │ └── ShellServerImpl.java │ │ └── util │ │ ├── AgentConfig.java │ │ └── TypeResponseResult.java │ └── test │ └── qunar │ └── tc │ └── bistory │ ├── BitTest.java │ ├── JarJarFileRead.java │ ├── QmonitorTest.java │ └── Test.java ├── bistoury-attach-common ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── attach │ ├── common │ ├── AttachJacksonSerializer.java │ ├── BistouryLoggerHelper.java │ └── BistouryLoggger.java │ └── file │ ├── AbstractFileService.java │ ├── FileOperateFactory.java │ ├── FileService.java │ ├── JarStorePathUtil.java │ ├── URLUtil.java │ ├── bean │ └── FileBean.java │ └── impl │ ├── DefaultFileServiceImpl.java │ ├── JarFileServiceImpl.java │ └── JarFileServiceWrapper.java ├── bistoury-clientside-common ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── clientside │ └── common │ ├── meta │ ├── DefaultMetaStore.java │ ├── MetaStore.java │ ├── MetaStores.java │ └── Numbers.java │ ├── monitor │ ├── MetricType.java │ ├── MetricsData.java │ ├── MetricsSnapshot.java │ └── ValueType.java │ └── store │ └── BistouryStore.java ├── bistoury-commands ├── pom.xml └── src │ ├── main │ ├── java │ │ └── qunar │ │ │ └── tc │ │ │ └── bistoury │ │ │ └── commands │ │ │ ├── CustomScript.java │ │ │ ├── HeartbeatProcessor.java │ │ │ ├── JdkProcessCmdTaskFactory.java │ │ │ ├── MetaRefreshProcessor.java │ │ │ ├── MetaRefreshTipProcessor.java │ │ │ ├── ProcessorUtils.java │ │ │ ├── SystemTask.java │ │ │ ├── arthas │ │ │ ├── ArthasEntity.java │ │ │ ├── ArthasStarter.java │ │ │ ├── ArthasTask.java │ │ │ ├── ArthasTaskFactory.java │ │ │ ├── TelnetConstants.java │ │ │ └── telnet │ │ │ │ ├── AbstractTelnet.java │ │ │ │ ├── AbstractTelnetStore.java │ │ │ │ ├── CommunicateUtil.java │ │ │ │ ├── CompositeBytes.java │ │ │ │ ├── IllegalVersionException.java │ │ │ │ ├── NormalTelnet.java │ │ │ │ ├── NormalTelnetStore.java │ │ │ │ ├── PromptBufData.java │ │ │ │ ├── PromptProcessor.java │ │ │ │ ├── ResultProcessor.java │ │ │ │ ├── SkipFirstLineProcessor.java │ │ │ │ ├── Telnet.java │ │ │ │ ├── TelnetStore.java │ │ │ │ ├── UrlDecodeProcessor.java │ │ │ │ ├── UrlEncodedTelnet.java │ │ │ │ ├── UrlEncodedTelnetStore.java │ │ │ │ └── Writer.java │ │ │ ├── cpujstack │ │ │ ├── CpuTimeTask.java │ │ │ ├── CpuTimeTaskFactory.java │ │ │ ├── ThreadInfoTask.java │ │ │ ├── ThreadInfoTaskFactory.java │ │ │ ├── ThreadNumTask.java │ │ │ └── ThreadNumTaskFactory.java │ │ │ ├── decompiler │ │ │ ├── Decompiler.java │ │ │ ├── DecompilerTask.java │ │ │ ├── DecompilerTaskFactory.java │ │ │ ├── IBytecodeProviderImpl.java │ │ │ └── IResultSaverImpl.java │ │ │ ├── download │ │ │ ├── DownloadFileBean.java │ │ │ ├── DownloadFileListTask.java │ │ │ ├── DownloadFileListTaskFactory.java │ │ │ ├── DownloadFileTask.java │ │ │ └── DownloadFileTaskFactory.java │ │ │ ├── heapHisto │ │ │ ├── HeapHistoBeanHandle.java │ │ │ ├── HeapHistoStore.java │ │ │ ├── HeapHistoTask.java │ │ │ ├── HeapHistoTaskFactory.java │ │ │ └── HistogramBean.java │ │ │ ├── host │ │ │ ├── HostInfo.java │ │ │ ├── HostTask.java │ │ │ ├── HostTaskFactory.java │ │ │ ├── ThreadInfoTask.java │ │ │ ├── ThreadInfoTaskFactory.java │ │ │ ├── VMSnapshotBean.java │ │ │ ├── VMSummaryInfo.java │ │ │ └── VirtualMachineUtil.java │ │ │ ├── monitor │ │ │ ├── QMonitorQueryTask.java │ │ │ ├── QMonitorQueryTaskFactory.java │ │ │ └── QMonitorStore.java │ │ │ ├── perf │ │ │ └── PerfData.java │ │ │ ├── profiler │ │ │ ├── ProfilerFileForProxyTask.java │ │ │ └── ProfilerFileForProxyTaskFactory.java │ │ │ └── qjtools │ │ │ └── util │ │ │ └── ReflectUtil.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── qunar.tc.bistoury.remoting.netty.TaskFactory │ └── test │ └── java │ ├── VMTest.java │ └── qunar │ └── tc │ └── bistoury │ └── commands │ ├── CPULoadAverages.java │ ├── ConsoleResponseHandler.java │ ├── CustomScriptTest.java │ ├── GZFile.java │ ├── JVMTest.java │ ├── MemDisk.java │ ├── StringFormatTest.java │ ├── ThreadDumpTest.java │ ├── arthas │ └── telnet │ │ └── TestCompositeBytes.java │ └── decompiler │ └── DecompilerTest.java ├── bistoury-common ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── common │ ├── AESCryptUtils.java │ ├── AsyncHttpClientHolder.java │ ├── Base64.java │ ├── BistouryConstants.java │ ├── CharsetUtils.java │ ├── CodeProcessResponse.java │ ├── DateUtil.java │ ├── FileUtil.java │ ├── JacksonSerializer.java │ ├── JsonResult.java │ ├── NamedThreadFactory.java │ ├── OsUtils.java │ ├── ProfilerUtil.java │ ├── Snapshot.java │ ├── Status.java │ ├── Throwables.java │ ├── TypeResponse.java │ ├── URLCoder.java │ ├── VersionUtil.java │ └── profiler │ ├── compact │ ├── CompactClassHelper.java │ ├── Trie.java │ └── TrieNode.java │ └── method │ ├── FunctionInfo.java │ ├── MethodCache.java │ └── MethodInfo.java ├── bistoury-decompiler-fernflower ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── qunar │ │ └── tc │ │ └── decompiler │ │ ├── code │ │ ├── CodeConstants.java │ │ ├── ExceptionHandler.java │ │ ├── ExceptionTable.java │ │ ├── FullInstructionSequence.java │ │ ├── Instruction.java │ │ ├── InstructionSequence.java │ │ ├── JumpInstruction.java │ │ ├── SimpleInstructionSequence.java │ │ ├── SwitchInstruction.java │ │ ├── cfg │ │ │ ├── BasicBlock.java │ │ │ ├── ControlFlowGraph.java │ │ │ └── ExceptionRangeCFG.java │ │ └── interpreter │ │ │ └── InstructionImpact.java │ │ ├── jdk827 │ │ ├── List827.java │ │ ├── Map827.java │ │ └── Set827.java │ │ ├── main │ │ ├── AssertProcessor.java │ │ ├── ClassReference14Processor.java │ │ ├── ClassWriter.java │ │ ├── ClassesProcessor.java │ │ ├── DecompilerContext.java │ │ ├── EnumProcessor.java │ │ ├── Fernflower.java │ │ ├── InitializerProcessor.java │ │ ├── collectors │ │ │ ├── BytecodeMappingTracer.java │ │ │ ├── BytecodeSourceMapper.java │ │ │ ├── CounterContainer.java │ │ │ ├── ImportCollector.java │ │ │ └── VarNamesCollector.java │ │ ├── decompiler │ │ │ ├── BaseDecompiler.java │ │ │ ├── ConsoleDecompiler.java │ │ │ └── PrintStreamLogger.java │ │ ├── extern │ │ │ ├── IBytecodeProvider.java │ │ │ ├── IFernflowerLogger.java │ │ │ ├── IFernflowerPreferences.java │ │ │ ├── IIdentifierRenamer.java │ │ │ └── IResultSaver.java │ │ └── rels │ │ │ ├── ClassWrapper.java │ │ │ ├── LambdaProcessor.java │ │ │ ├── MethodProcessorRunnable.java │ │ │ ├── MethodWrapper.java │ │ │ ├── NestedClassProcessor.java │ │ │ └── NestedMemberAccess.java │ │ ├── modules │ │ ├── code │ │ │ └── DeadCodeHelper.java │ │ ├── decompiler │ │ │ ├── ClasspathHelper.java │ │ │ ├── ClearStructHelper.java │ │ │ ├── ConcatenationHelper.java │ │ │ ├── DecHelper.java │ │ │ ├── DomHelper.java │ │ │ ├── ExitHelper.java │ │ │ ├── ExprProcessor.java │ │ │ ├── ExprentStack.java │ │ │ ├── FinallyProcessor.java │ │ │ ├── IdeaNotNullHelper.java │ │ │ ├── IfHelper.java │ │ │ ├── InlineSingleBlockHelper.java │ │ │ ├── LabelHelper.java │ │ │ ├── LoopExtractHelper.java │ │ │ ├── MergeHelper.java │ │ │ ├── PPandMMHelper.java │ │ │ ├── PrimitiveExprsList.java │ │ │ ├── SecondaryFunctionsHelper.java │ │ │ ├── SequenceHelper.java │ │ │ ├── SimplifyExprentsHelper.java │ │ │ ├── StackVarsProcessor.java │ │ │ ├── StatEdge.java │ │ │ ├── StrongConnectivityHelper.java │ │ │ ├── SwitchHelper.java │ │ │ ├── decompose │ │ │ │ ├── DominatorEngine.java │ │ │ │ ├── DominatorTreeExceptionFilter.java │ │ │ │ ├── FastExtendedPostdominanceHelper.java │ │ │ │ ├── GenericDominatorEngine.java │ │ │ │ ├── IGraph.java │ │ │ │ └── IGraphNode.java │ │ │ ├── deobfuscator │ │ │ │ ├── ExceptionDeobfuscator.java │ │ │ │ └── IrreducibleCFGDeobfuscator.java │ │ │ ├── exps │ │ │ │ ├── AnnotationExprent.java │ │ │ │ ├── ArrayExprent.java │ │ │ │ ├── AssertExprent.java │ │ │ │ ├── AssignmentExprent.java │ │ │ │ ├── ConstExprent.java │ │ │ │ ├── ExitExprent.java │ │ │ │ ├── ExprUtil.java │ │ │ │ ├── Exprent.java │ │ │ │ ├── FieldExprent.java │ │ │ │ ├── FunctionExprent.java │ │ │ │ ├── IfExprent.java │ │ │ │ ├── InvocationExprent.java │ │ │ │ ├── MonitorExprent.java │ │ │ │ ├── NewExprent.java │ │ │ │ ├── SwitchExprent.java │ │ │ │ ├── TypeAnnotation.java │ │ │ │ └── VarExprent.java │ │ │ ├── sforms │ │ │ │ ├── DirectGraph.java │ │ │ │ ├── DirectNode.java │ │ │ │ ├── FlattenStatementsHelper.java │ │ │ │ ├── SSAConstructorSparseEx.java │ │ │ │ └── SSAUConstructorSparseEx.java │ │ │ ├── stats │ │ │ │ ├── BasicBlockStatement.java │ │ │ │ ├── CatchAllStatement.java │ │ │ │ ├── CatchStatement.java │ │ │ │ ├── DoStatement.java │ │ │ │ ├── DummyExitStatement.java │ │ │ │ ├── GeneralStatement.java │ │ │ │ ├── IfStatement.java │ │ │ │ ├── RootStatement.java │ │ │ │ ├── SequenceStatement.java │ │ │ │ ├── Statement.java │ │ │ │ ├── Statements.java │ │ │ │ ├── SwitchStatement.java │ │ │ │ └── SynchronizedStatement.java │ │ │ └── vars │ │ │ │ ├── CheckTypesResult.java │ │ │ │ ├── VarDefinitionHelper.java │ │ │ │ ├── VarProcessor.java │ │ │ │ ├── VarTypeProcessor.java │ │ │ │ ├── VarVersionEdge.java │ │ │ │ ├── VarVersionNode.java │ │ │ │ ├── VarVersionPair.java │ │ │ │ ├── VarVersionsGraph.java │ │ │ │ └── VarVersionsProcessor.java │ │ └── renamer │ │ │ ├── ClassWrapperNode.java │ │ │ ├── ConverterHelper.java │ │ │ ├── IdentifierConverter.java │ │ │ └── PoolInterceptor.java │ │ ├── struct │ │ ├── ContextUnit.java │ │ ├── IDecompiledData.java │ │ ├── StructClass.java │ │ ├── StructContext.java │ │ ├── StructField.java │ │ ├── StructMember.java │ │ ├── StructMethod.java │ │ ├── attr │ │ │ ├── StructAnnDefaultAttribute.java │ │ │ ├── StructAnnotationAttribute.java │ │ │ ├── StructAnnotationParameterAttribute.java │ │ │ ├── StructBootstrapMethodsAttribute.java │ │ │ ├── StructConstantValueAttribute.java │ │ │ ├── StructEnclosingMethodAttribute.java │ │ │ ├── StructExceptionsAttribute.java │ │ │ ├── StructGeneralAttribute.java │ │ │ ├── StructGenericSignatureAttribute.java │ │ │ ├── StructInnerClassesAttribute.java │ │ │ ├── StructLineNumberTableAttribute.java │ │ │ ├── StructLocalVariableTableAttribute.java │ │ │ ├── StructLocalVariableTypeTableAttribute.java │ │ │ ├── StructMethodParametersAttribute.java │ │ │ └── StructTypeAnnotationAttribute.java │ │ ├── consts │ │ │ ├── ConstantPool.java │ │ │ ├── LinkConstant.java │ │ │ ├── PooledConstant.java │ │ │ └── PrimitiveConstant.java │ │ ├── gen │ │ │ ├── DataPoint.java │ │ │ ├── FieldDescriptor.java │ │ │ ├── MethodDescriptor.java │ │ │ ├── NewClassNameBuilder.java │ │ │ ├── VarType.java │ │ │ └── generics │ │ │ │ ├── GenericClassDescriptor.java │ │ │ │ ├── GenericFieldDescriptor.java │ │ │ │ ├── GenericMain.java │ │ │ │ ├── GenericMethodDescriptor.java │ │ │ │ └── GenericType.java │ │ ├── lazy │ │ │ └── LazyLoader.java │ │ └── match │ │ │ ├── IMatchable.java │ │ │ ├── MatchEngine.java │ │ │ └── MatchNode.java │ │ └── util │ │ ├── DataInputFullStream.java │ │ ├── FastFixedSetFactory.java │ │ ├── FastSparseSetFactory.java │ │ ├── InterpreterUtil.java │ │ ├── ListStack.java │ │ ├── SFormsFastMapDirect.java │ │ ├── TextBuffer.java │ │ ├── TextUtil.java │ │ └── VBStyleCollection.java │ └── test │ └── java │ └── qunar │ └── tc │ └── decompiler │ └── ClassTest.java ├── bistoury-dist ├── assembly │ └── assembly-agent.xml ├── bin │ ├── async-profiler │ │ ├── async-profiler-1.6-linux-x64.so │ │ └── async-profiler-1.6-macos-x64.so │ ├── base.sh │ ├── bistoury-agent-env.sh │ ├── bistoury-agent.sh │ ├── inputrc │ ├── qjdump.sh │ ├── qjmap.sh │ ├── qjmxcli.sh │ ├── qjtool-base.sh │ └── qjtop.sh └── pom.xml ├── bistoury-independent-agent ├── pom.xml └── src │ └── main │ ├── java │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── indpendent │ │ └── agent │ │ └── Main.java │ └── resources │ └── logback.xml ├── bistoury-instrument-agent ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── instrument │ └── agent │ ├── AgentBootstrap2.java │ └── BistouryClassloader.java ├── bistoury-instrument-client ├── pom.xml └── src │ ├── main │ └── java │ │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── instrument │ │ └── client │ │ ├── classpath │ │ ├── AppClassPathSupplier.java │ │ ├── AppClassPathSupplierFactory.java │ │ ├── AppLibClassSupplier.java │ │ ├── DefaultAppClassPathSupplier.java │ │ ├── DefaultAppLibClassSupplier.java │ │ ├── SettableAppClassPathSupplier.java │ │ └── WebAppClassPathSupplier.java │ │ ├── common │ │ ├── Access.java │ │ ├── ClassFileBuffer.java │ │ └── InstrumentInfo.java │ │ ├── debugger │ │ ├── AddBreakpointResult.java │ │ ├── Breakpoint.java │ │ ├── BreakpointConditionDTO.java │ │ ├── ClassField.java │ │ ├── ClassMetadata.java │ │ ├── Debugger.java │ │ ├── DebuggerClassFileTransformer.java │ │ ├── DebuggerClassVisitor.java │ │ ├── DebuggerMethodVisitor.java │ │ ├── DefaultDebugger.java │ │ ├── GlobalDebugContext.java │ │ ├── LocalVariable.java │ │ ├── MetadataCollector.java │ │ ├── MethodWhiteListChecker.java │ │ ├── SnapshotCapture.java │ │ ├── SnapshotReceiver.java │ │ └── Transformer.java │ │ ├── location │ │ ├── ClassPathLookup.java │ │ ├── ClassResourcesIndexer.java │ │ ├── FormatMessage.java │ │ ├── Location.java │ │ ├── Messages.java │ │ ├── MethodsFilter.java │ │ ├── ResolvedSourceLocation.java │ │ ├── ResourceIndexer.java │ │ ├── ResourcesDatabase.java │ │ ├── SourceFileMapper.java │ │ └── UniquifierComputer.java │ │ ├── metrics │ │ ├── AbstractProcessorMetricsReportor.java │ │ ├── Counter.java │ │ ├── Delta.java │ │ ├── DeltaCounter.java │ │ ├── DeltaKeyWrapper.java │ │ ├── Item.java │ │ ├── ItemValue.java │ │ ├── KeyWrapper.java │ │ ├── MetricKey.java │ │ ├── Metrics.java │ │ ├── MetricsReportor.java │ │ ├── QMonitorMetricsReportor.java │ │ ├── Timer.java │ │ └── adapter │ │ │ ├── CounterAdapter.java │ │ │ ├── ResettableTimer.java │ │ │ ├── ResettableTimerAdapter.java │ │ │ └── StatsBuffer.java │ │ ├── monitor │ │ ├── AgentGenerated.java │ │ ├── AgentMonitor.java │ │ ├── DefaultMonitor.java │ │ ├── GlobalMonitorContext.java │ │ ├── Matcher.java │ │ ├── Monitor.java │ │ ├── MonitorClassFileTransformer.java │ │ ├── MonitorClassVisitor.java │ │ └── MonitorMethodVisitor.java │ │ ├── profiler │ │ ├── AgentProfilerContext.java │ │ ├── Mode.java │ │ ├── Profiler.java │ │ ├── ProfilerConstants.java │ │ ├── ProfilerContext.java │ │ ├── ProfilerInfo.java │ │ ├── ProfilerManager.java │ │ ├── ProfilerStore.java │ │ ├── Profilers.java │ │ ├── async │ │ │ ├── AsyncProfilerContext.java │ │ │ ├── AsyncProfilerStore.java │ │ │ ├── Manager.java │ │ │ └── ProfilerCommand.java │ │ └── sync │ │ │ ├── Manager.java │ │ │ ├── SamplingProfiler.java │ │ │ ├── runtime │ │ │ ├── ProfilerData.java │ │ │ ├── ProfilerDataDumper.java │ │ │ ├── ProfilerDataRecorder.java │ │ │ └── cpu │ │ │ │ ├── DumpData.java │ │ │ │ └── ThreadCpuInfo.java │ │ │ └── task │ │ │ ├── DumpTask.java │ │ │ ├── ProfilerTask.java │ │ │ └── Task.java │ │ ├── spring │ │ └── el │ │ │ ├── AbstractDescriptor.java │ │ │ ├── AccessException.java │ │ │ ├── ArrayToArrayConverter.java │ │ │ ├── ArrayToCollectionConverter.java │ │ │ ├── ArrayToObjectConverter.java │ │ │ ├── ArrayToStringConverter.java │ │ │ ├── Assert.java │ │ │ ├── AstUtils.java │ │ │ ├── BeanPropertyDescriptor.java │ │ │ ├── BeanReference.java │ │ │ ├── BeanResolver.java │ │ │ ├── BooleanLiteral.java │ │ │ ├── BooleanTypedValue.java │ │ │ ├── BridgeMethodResolver.java │ │ │ ├── CharacterToNumberFactory.java │ │ │ ├── ClassDescriptor.java │ │ │ ├── ClassUtils.java │ │ │ ├── CodeFlow.java │ │ │ ├── CollectionFactory.java │ │ │ ├── CollectionToArrayConverter.java │ │ │ ├── CollectionToCollectionConverter.java │ │ │ ├── CollectionToObjectConverter.java │ │ │ ├── CollectionToStringConverter.java │ │ │ ├── CollectionUtils.java │ │ │ ├── CompilablePropertyAccessor.java │ │ │ ├── CompiledExpression.java │ │ │ ├── CompositeStringExpression.java │ │ │ ├── CompoundExpression.java │ │ │ ├── ConcurrentReferenceHashMap.java │ │ │ ├── ConditionalConverter.java │ │ │ ├── ConditionalGenericConverter.java │ │ │ ├── ConfigurableConversionService.java │ │ │ ├── ConstructorExecutor.java │ │ │ ├── ConstructorResolver.java │ │ │ ├── ConversionException.java │ │ │ ├── ConversionFailedException.java │ │ │ ├── ConversionService.java │ │ │ ├── ConversionUtils.java │ │ │ ├── Converter.java │ │ │ ├── ConverterFactory.java │ │ │ ├── ConverterNotFoundException.java │ │ │ ├── ConverterRegistry.java │ │ │ ├── DefaultConversionService.java │ │ │ ├── Elvis.java │ │ │ ├── EnumToStringConverter.java │ │ │ ├── EvaluationContext.java │ │ │ ├── EvaluationException.java │ │ │ ├── Expression.java │ │ │ ├── ExpressionException.java │ │ │ ├── ExpressionInvocationTargetException.java │ │ │ ├── ExpressionParser.java │ │ │ ├── ExpressionState.java │ │ │ ├── ExpressionUtils.java │ │ │ ├── FallbackObjectToStringConverter.java │ │ │ ├── FieldDescriptor.java │ │ │ ├── FloatLiteral.java │ │ │ ├── FormatHelper.java │ │ │ ├── FunctionReference.java │ │ │ ├── GenericCollectionTypeResolver.java │ │ │ ├── GenericConversionService.java │ │ │ ├── GenericConverter.java │ │ │ ├── GenericTypeResolver.java │ │ │ ├── IdToEntityConverter.java │ │ │ ├── Identifier.java │ │ │ ├── Indexer.java │ │ │ ├── InlineList.java │ │ │ ├── InlineMap.java │ │ │ ├── IntLiteral.java │ │ │ ├── InternalParseException.java │ │ │ ├── InternalSpelExpressionParser.java │ │ │ ├── LinkedCaseInsensitiveMap.java │ │ │ ├── LinkedMultiValueMap.java │ │ │ ├── Literal.java │ │ │ ├── LiteralExpression.java │ │ │ ├── LongLiteral.java │ │ │ ├── MapToMapConverter.java │ │ │ ├── MethodExecutor.java │ │ │ ├── MethodFilter.java │ │ │ ├── MethodParameter.java │ │ │ ├── MethodReference.java │ │ │ ├── MethodResolver.java │ │ │ ├── MultiValueMap.java │ │ │ ├── NestedExceptionUtils.java │ │ │ ├── NestedRuntimeException.java │ │ │ ├── NullLiteral.java │ │ │ ├── NumberToCharacterConverter.java │ │ │ ├── NumberToNumberConverterFactory.java │ │ │ ├── NumberUtils.java │ │ │ ├── ObjectToArrayConverter.java │ │ │ ├── ObjectToCollectionConverter.java │ │ │ ├── ObjectToObjectConverter.java │ │ │ ├── ObjectToStringConverter.java │ │ │ ├── ObjectUtils.java │ │ │ ├── OpAnd.java │ │ │ ├── OpDec.java │ │ │ ├── OpDivide.java │ │ │ ├── OpEQ.java │ │ │ ├── OpGE.java │ │ │ ├── OpGT.java │ │ │ ├── OpInc.java │ │ │ ├── OpLE.java │ │ │ ├── OpLT.java │ │ │ ├── OpMinus.java │ │ │ ├── OpModulus.java │ │ │ ├── OpMultiply.java │ │ │ ├── OpNE.java │ │ │ ├── OpOr.java │ │ │ ├── OpPlus.java │ │ │ ├── Operation.java │ │ │ ├── Operator.java │ │ │ ├── OperatorBetween.java │ │ │ ├── OperatorInstanceof.java │ │ │ ├── OperatorMatches.java │ │ │ ├── OperatorNot.java │ │ │ ├── OperatorOverloader.java │ │ │ ├── OperatorPower.java │ │ │ ├── ParameterDescriptor.java │ │ │ ├── ParameterNameDiscoverer.java │ │ │ ├── ParseException.java │ │ │ ├── ParserContext.java │ │ │ ├── Projection.java │ │ │ ├── PropertiesToStringConverter.java │ │ │ ├── Property.java │ │ │ ├── PropertyAccessor.java │ │ │ ├── PropertyOrFieldReference.java │ │ │ ├── QualifiedIdentifier.java │ │ │ ├── RealLiteral.java │ │ │ ├── ReflectionHelper.java │ │ │ ├── ReflectionUtils.java │ │ │ ├── ReflectiveConstructorExecutor.java │ │ │ ├── ReflectiveConstructorResolver.java │ │ │ ├── ReflectiveMethodExecutor.java │ │ │ ├── ReflectiveMethodResolver.java │ │ │ ├── ReflectivePropertyAccessor.java │ │ │ ├── Selection.java │ │ │ ├── SpelCompiler.java │ │ │ ├── SpelCompilerMode.java │ │ │ ├── SpelEvaluationException.java │ │ │ ├── SpelExpression.java │ │ │ ├── SpelExpressionParser.java │ │ │ ├── SpelMessage.java │ │ │ ├── SpelNode.java │ │ │ ├── SpelNodeImpl.java │ │ │ ├── SpelParseException.java │ │ │ ├── SpelParserConfiguration.java │ │ │ ├── SpringProperties.java │ │ │ ├── StandardEvaluationContext.java │ │ │ ├── StandardOperatorOverloader.java │ │ │ ├── StandardTypeComparator.java │ │ │ ├── StandardTypeConverter.java │ │ │ ├── StandardTypeLocator.java │ │ │ ├── StringLiteral.java │ │ │ ├── StringToArrayConverter.java │ │ │ ├── StringToBooleanConverter.java │ │ │ ├── StringToCharacterConverter.java │ │ │ ├── StringToCollectionConverter.java │ │ │ ├── StringToEnumConverterFactory.java │ │ │ ├── StringToLocaleConverter.java │ │ │ ├── StringToNumberConverterFactory.java │ │ │ ├── StringToPropertiesConverter.java │ │ │ ├── StringToUUIDConverter.java │ │ │ ├── StringUtils.java │ │ │ ├── TemplateAwareExpressionParser.java │ │ │ ├── Ternary.java │ │ │ ├── Token.java │ │ │ ├── TokenKind.java │ │ │ ├── Tokenizer.java │ │ │ ├── TypeCode.java │ │ │ ├── TypeComparator.java │ │ │ ├── TypeConverter.java │ │ │ ├── TypeDescriptor.java │ │ │ ├── TypeLocator.java │ │ │ ├── TypeReference.java │ │ │ ├── TypedValue.java │ │ │ ├── ValueRef.java │ │ │ └── VariableReference.java │ │ └── util │ │ └── DescDeal.java │ └── test │ └── java │ └── qunar │ └── tc │ └── test │ ├── ASMTest.java │ ├── ExceptionTest.java │ ├── MethodVistorTest.java │ ├── MonitorAdviceAdapter.java │ ├── MonitorTest.java │ └── Test.java ├── bistoury-instrument-spy ├── pom.xml └── src │ └── main │ └── java │ ├── one │ └── profiler │ │ ├── AsyncProfiler.java │ │ ├── AsyncProfilerMXBean.java │ │ ├── Counter.java │ │ ├── Events.java │ │ └── package-info.java │ └── qunar │ └── tc │ └── bistoury │ └── instrument │ └── spy │ └── BistourySpys1.java ├── bistoury-magic-classes ├── pom.xml └── src │ └── main │ └── java │ ├── com │ ├── fasterxml │ │ └── jackson │ │ │ └── databind │ │ │ └── ser │ │ │ └── BeanSerializerFactory.java │ └── taobao │ │ └── arthas │ │ └── core │ │ ├── advisor │ │ └── Enhancer.java │ │ └── shell │ │ └── term │ │ └── impl │ │ └── Helper.java │ └── qunar │ └── tc │ └── bistoury │ └── magic │ └── classes │ ├── MagicClasses.java │ └── MagicUtils.java ├── bistoury-magic-loader ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── magic │ └── loader │ └── MagicClassLoader.java ├── bistoury-metrics-prometheus ├── pom.xml └── src │ └── main │ ├── java │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── metrics │ │ └── prometheus │ │ ├── PrometheusBistouryCounter.java │ │ ├── PrometheusBistouryGauge.java │ │ ├── PrometheusBistouryMeter.java │ │ ├── PrometheusBistouryMetricRegistry.java │ │ └── PrometheusBistouryTimer.java │ └── resources │ └── META-INF │ └── services │ └── qunar.tc.bistoury.serverside.metrics.BistouryMetricRegistry ├── bistoury-proxy ├── conf │ ├── agent_config.properties │ ├── agent_config_override.properties │ ├── download_dir_limit.properties │ ├── global.properties │ ├── jdbc.properties │ ├── profiler.properties │ ├── prometheus.properties │ ├── registry.properties │ ├── releaseInfo_config.properties │ └── server.properties ├── pom.xml └── src │ ├── assembly │ └── assembly-proxy.xml │ ├── bin │ ├── base.sh │ ├── bistoury-proxy-env.sh │ └── bistoury-proxy.sh │ ├── main │ ├── java │ │ └── qunar │ │ │ └── tc │ │ │ └── bistoury │ │ │ └── proxy │ │ │ ├── communicate │ │ │ ├── AbstractConnection.java │ │ │ ├── Connection.java │ │ │ ├── DefaultSession.java │ │ │ ├── DefaultSessionManager.java │ │ │ ├── MessageProcessor.java │ │ │ ├── NettyServer.java │ │ │ ├── Session.java │ │ │ ├── SessionManager.java │ │ │ ├── WritableListener.java │ │ │ ├── WriteResult.java │ │ │ ├── agent │ │ │ │ ├── AgentConnection.java │ │ │ │ ├── AgentConnectionStore.java │ │ │ │ ├── DefaultAgentConnection.java │ │ │ │ ├── DefaultAgentConnectionStore.java │ │ │ │ ├── NettyServerForAgent.java │ │ │ │ └── handler │ │ │ │ │ ├── AgentInfoRefreshProcessor.java │ │ │ │ │ ├── AgentMessageHandler.java │ │ │ │ │ ├── AgentMessageProcessor.java │ │ │ │ │ ├── AgentProfilerFileProcessor.java │ │ │ │ │ ├── AgentResponseProcessor.java │ │ │ │ │ └── ProxyHeartbeatProcessor.java │ │ │ ├── handle │ │ │ │ ├── ChannelCloseHandler.java │ │ │ │ └── ConnectionCounterHandler.java │ │ │ └── ui │ │ │ │ ├── DefaultUiConnection.java │ │ │ │ ├── DefaultUiConnectionStore.java │ │ │ │ ├── NettyServerForUi.java │ │ │ │ ├── UiConnection.java │ │ │ │ ├── UiConnectionStore.java │ │ │ │ ├── UiResponses.java │ │ │ │ ├── command │ │ │ │ ├── CommunicateCommand.java │ │ │ │ ├── CommunicateCommandStore.java │ │ │ │ ├── DefaultCommunicateCommandStore.java │ │ │ │ └── UiRequestCommand.java │ │ │ │ ├── handler │ │ │ │ ├── HostsValidatorHandler.java │ │ │ │ ├── RequestDecoder.java │ │ │ │ ├── TabHandler.java │ │ │ │ ├── UiRequestHandler.java │ │ │ │ ├── WebSocketEncoder.java │ │ │ │ └── commandprocessor │ │ │ │ │ ├── AbstractCommand.java │ │ │ │ │ ├── CommunicateCommandProcessor.java │ │ │ │ │ └── processor │ │ │ │ │ ├── ArthasCommandProcessor.java │ │ │ │ │ ├── CancelProcessor.java │ │ │ │ │ ├── DecompilerProcessor.java │ │ │ │ │ ├── DownloadFileListProcessor.java │ │ │ │ │ ├── DownloadFileProcessor.java │ │ │ │ │ ├── HeapHistoProcessor.java │ │ │ │ │ ├── HostInfoProcessor.java │ │ │ │ │ ├── JStackCpuTimeProcessor.java │ │ │ │ │ ├── JStackThreadInfoProcessor.java │ │ │ │ │ ├── JStackThreadNumProcessor.java │ │ │ │ │ ├── JavaCommandProcessor.java │ │ │ │ │ ├── LinuxCommandProcessor.java │ │ │ │ │ ├── ProfilerStartProcessor.java │ │ │ │ │ ├── ProfilerStateProcessor.java │ │ │ │ │ ├── ProfilerStopProcessor.java │ │ │ │ │ ├── QJToolsProcessor.java │ │ │ │ │ ├── QMonitorQueryProcessor.java │ │ │ │ │ └── ThreadInfoProcessor.java │ │ │ │ └── linuxcommand │ │ │ │ ├── CommandSplitter.java │ │ │ │ ├── LinuxCommand.java │ │ │ │ ├── LinuxCommandParser.java │ │ │ │ └── StandardCommand.java │ │ │ ├── config │ │ │ ├── AgentInfoManager.java │ │ │ ├── AgentInfoOverride.java │ │ │ └── DefaultAgentInfoManager.java │ │ │ ├── container │ │ │ └── Bootstrap.java │ │ │ ├── dao │ │ │ ├── ProfilerDao.java │ │ │ ├── ProfilerDaoImpl.java │ │ │ ├── ProfilerLockDao.java │ │ │ └── ProfilerLockDaoImpl.java │ │ │ ├── generator │ │ │ ├── IdGenerator.java │ │ │ └── SessionIdGenerator.java │ │ │ ├── service │ │ │ ├── impl │ │ │ │ ├── DefaultProfilerDataManager.java │ │ │ │ ├── DefaultProfilerManager.java │ │ │ │ ├── DefaultProfilerSettingsStore.java │ │ │ │ ├── ProfilerServiceImpl.java │ │ │ │ └── ProfilerSettingsManagerImpl.java │ │ │ └── profiler │ │ │ │ ├── ProfilerDataManager.java │ │ │ │ ├── ProfilerManager.java │ │ │ │ ├── ProfilerService.java │ │ │ │ ├── ProfilerSettingsManager.java │ │ │ │ └── ProfilerSettingsStore.java │ │ │ ├── startup │ │ │ └── NettyServerManager.java │ │ │ ├── util │ │ │ ├── AppCenterServerFinder.java │ │ │ ├── ChannelUtils.java │ │ │ ├── DownloadDirUtils.java │ │ │ ├── FutureSuccessCallBack.java │ │ │ ├── ProfilerDatagramHelper.java │ │ │ ├── ServerFinder.java │ │ │ └── profiler │ │ │ │ ├── CallStackCounter.java │ │ │ │ ├── FunctionCounter.java │ │ │ │ ├── HotSpotMethodFormatter.java │ │ │ │ ├── HotSpotMethodParser.java │ │ │ │ ├── ProfilerAnalyzer.java │ │ │ │ ├── ProfilerDatagramHelper.java │ │ │ │ └── TreeNode.java │ │ │ └── web │ │ │ └── controller │ │ │ ├── AgentGetController.java │ │ │ ├── AgentMetaRefreshNotifyController.java │ │ │ ├── AgentProfilerForUiController.java │ │ │ ├── AgentVersionController.java │ │ │ └── ProxyConfigForAgentGetController.java │ ├── resources.local │ │ └── spring │ │ │ └── database.xml │ ├── resources │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── qunar.tc.bistoury.serverside.jdbc.DataSourceFactory │ │ ├── logback.xml │ │ ├── script │ │ │ ├── flamegraph-count.pl │ │ │ └── flamegraph-time.pl │ │ └── spring │ │ │ ├── context.xml │ │ │ ├── database.xml │ │ │ └── dispatcherServlet.xml │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── css │ │ └── bootstrap.min.css │ │ ├── favicon.ico │ │ ├── index.jsp │ │ ├── js │ │ ├── bootstrap.min.js │ │ └── jquery-3.3.1.min.js │ │ └── proxy.html │ └── test │ ├── java │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── proxy │ │ └── container │ │ └── ProxyBootstrapForTest.java │ └── resources │ └── conf │ ├── agent_config.properties │ ├── agent_config_override.properties │ ├── global.properties │ ├── jdbc.properties │ ├── profiler.properties │ ├── prometheus.properties │ ├── registry.properties │ ├── releaseInfo_config.properties │ └── server.properties ├── bistoury-remoting ├── pom.xml └── src │ ├── main │ └── java │ │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── remoting │ │ ├── CommandCodeProcessor.java │ │ ├── coder │ │ ├── AgentDecoder.java │ │ └── AgentEncoder.java │ │ ├── command │ │ ├── CommandSerializer.java │ │ ├── CpuTimeCommand.java │ │ ├── DecompilerCommand.java │ │ ├── DownloadCommand.java │ │ ├── HeapHistoCommand.java │ │ ├── MachineCommand.java │ │ ├── MonitorCommand.java │ │ ├── ThreadCommand.java │ │ └── ThreadNumCommand.java │ │ ├── netty │ │ ├── AgentConstants.java │ │ ├── AgentRemotingExecutor.java │ │ ├── CancelProcessor.java │ │ ├── DefaultRunningTask.java │ │ ├── DefaultTaskStore.java │ │ ├── JobPauseProcessor.java │ │ ├── JobResumeProcessor.java │ │ ├── NettyExecuteHandler.java │ │ ├── Processor.java │ │ ├── RequestHandler.java │ │ ├── ResponseWriter.java │ │ ├── RunnableTask.java │ │ ├── RunnableTasks.java │ │ ├── Task.java │ │ ├── TaskFactory.java │ │ ├── TaskProcessor.java │ │ └── TaskStore.java │ │ ├── protocol │ │ ├── AgentServerInfo.java │ │ ├── CodeTypeMappingStore.java │ │ ├── CodeTypeMappingStores.java │ │ ├── CommandCode.java │ │ ├── Datagram.java │ │ ├── DefaultCodeTypeMappingStore.java │ │ ├── ErrorCode.java │ │ ├── PayloadHolder.java │ │ ├── RemotingBuilder.java │ │ ├── RemotingHeader.java │ │ ├── RequestData.java │ │ ├── ResponseCode.java │ │ └── payloadHolderImpl │ │ │ ├── ErrorResponsePayloadHolder.java │ │ │ ├── RequestPayloadHolder.java │ │ │ ├── ResponsePayloadHolder.java │ │ │ └── ResponseStringPayloadHolder.java │ │ └── util │ │ ├── LocalHost.java │ │ └── PayloadHolderUtils.java │ └── test │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── remoting │ ├── PSTest.java │ └── netty │ └── qjtools │ └── QJToolsPrintStreamTest.java ├── bistoury-serverside-common ├── pom.xml └── src │ └── main │ ├── java │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── serverside │ │ ├── agile │ │ ├── Base64.java │ │ ├── Conf.java │ │ ├── Numbers.java │ │ └── Strings.java │ │ ├── bean │ │ ├── ApiResult.java │ │ ├── ApiStatus.java │ │ ├── Profiler.java │ │ └── ProfilerSettings.java │ │ ├── common │ │ ├── BistouryServerConstants.java │ │ ├── MockZkClientImpl.java │ │ ├── UUIDUtil.java │ │ ├── ZKClient.java │ │ ├── ZKClientCache.java │ │ ├── ZKClientImpl.java │ │ └── encryption │ │ │ ├── DefaultRequestEncryption.java │ │ │ ├── Encryption.java │ │ │ ├── EncryptionUtils.java │ │ │ ├── RSAEncryption.java │ │ │ └── RequestEncryption.java │ │ ├── configuration │ │ ├── DynamicConfig.java │ │ ├── DynamicConfigFactory.java │ │ ├── DynamicConfigLoader.java │ │ ├── Listener.java │ │ └── local │ │ │ ├── ConfigWatcher.java │ │ │ ├── LocalDynamicConfig.java │ │ │ └── LocalDynamicConfigFactory.java │ │ ├── database │ │ └── H2DataBeseUtil.java │ │ ├── exception │ │ └── PermissionDenyException.java │ │ ├── jdbc │ │ ├── DataSourceFactory.java │ │ ├── DefaultDataSourceFactory.java │ │ └── JdbcTemplateHolder.java │ │ ├── metrics │ │ ├── BistouryCounter.java │ │ ├── BistouryMeter.java │ │ ├── BistouryMetricRegistry.java │ │ ├── BistouryTimer.java │ │ ├── Metrics.java │ │ └── MockRegistry.java │ │ ├── store │ │ └── RegistryStore.java │ │ └── util │ │ ├── BistouryFileStoreUtil.java │ │ ├── ResultHelper.java │ │ └── ServerManager.java │ └── resources │ ├── META-INF │ └── services │ │ └── qunar.tc.bistoury.serverside.configuration.DynamicConfigFactory │ ├── rsa-private-key.pem │ └── rsa-public-key.pem ├── bistoury-ui-service-impl ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── ui │ ├── dao │ ├── GitlabPrivateTokenDao.java │ ├── ProfilerDao.java │ ├── UserDao.java │ └── impl │ │ ├── GitlabPrivateTokenDaoImpl.java │ │ ├── ProfilerDaoImpl.java │ │ └── UserDaoImpl.java │ ├── git │ ├── GitRepositoryApi.java │ ├── GithubRepositoryApiImpl.java │ └── GitlabRepositoryApiImpl.java │ ├── security │ ├── LoginContext.java │ └── LoginInterceptorImpl.java │ └── service │ └── impl │ ├── AESCryptServiceImpl.java │ ├── BistouryLoginManager.java │ ├── DefaultJarFileStore.java │ ├── GitPrivateTokenServiceImpl.java │ ├── GitRepositoryStoreServiceImpl.java │ ├── LinkRedirectServiceImpl.java │ ├── MavenRepositoryServiceImpl.java │ ├── ProfilerServiceImpl.java │ ├── ProxyServiceImpl.java │ ├── ReleaseInfoServiceImpl.java │ └── UserServiceImpl.java ├── bistoury-ui-service ├── pom.xml └── src │ └── main │ └── java │ └── qunar │ └── tc │ └── bistoury │ └── ui │ ├── exception │ ├── GlobalExceptionHandler.java │ ├── SourceFileNotFoundException.java │ └── SourceFileReadException.java │ ├── model │ ├── GitHubFile.java │ ├── GitlabFile.java │ ├── MavenInfo.java │ ├── PrivateToken.java │ ├── ReleaseInfo.java │ └── User.java │ ├── security │ └── LoginInterceptor.java │ ├── service │ ├── AESCryptService.java │ ├── GitPrivateTokenService.java │ ├── GitRepositoryStoreService.java │ ├── JarFileStore.java │ ├── LoginManager.java │ ├── MavenRepositoryService.java │ ├── ProfilerService.java │ ├── ProxyService.java │ ├── ReleaseInfoService.java │ ├── URLRedirectService.java │ └── UserService.java │ └── util │ ├── PropertiesReleaseInfoParser.java │ ├── ProxyInfo.java │ ├── ProxyInfoParser.java │ └── ReleaseInfoParse.java ├── bistoury-ui ├── conf │ ├── config.properties │ ├── jdbc.properties │ ├── prometheus.properties │ ├── registry.properties │ ├── server.properties │ └── url_redirect.properties ├── pom.xml ├── sql │ └── bistoury_init.sql └── src │ ├── assembly │ └── assembly-ui.xml │ ├── bin │ ├── base.sh │ ├── bistoury-ui-env.sh │ └── bistoury-ui.sh │ ├── main │ ├── java │ │ └── qunar │ │ │ └── tc │ │ │ └── bistoury │ │ │ └── ui │ │ │ ├── connection │ │ │ └── DownloadWebSocket.java │ │ │ ├── container │ │ │ └── Bootstrap.java │ │ │ ├── controller │ │ │ ├── AgentMetaController.java │ │ │ ├── AppController.java │ │ │ ├── AppServerController.java │ │ │ ├── ApplicationController.java │ │ │ ├── ConfigController.java │ │ │ ├── DownloadFileController.java │ │ │ ├── ErrorCodeMappingController.java │ │ │ ├── GitlabRepositoryApiController.java │ │ │ ├── HelpController.java │ │ │ ├── LoginController.java │ │ │ ├── MavenRepositoryApiController.java │ │ │ ├── PrivateTokenApiController.java │ │ │ ├── ProfilerController.java │ │ │ ├── ReleaseInfoController.java │ │ │ └── URLRedirectController.java │ │ │ └── filter │ │ │ ├── XSSRequestWrapper.java │ │ │ └── XssFilter.java │ ├── resources.local │ │ └── spring │ │ │ └── database.xml │ ├── resources │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── qunar.tc.bistoury.serverside.jdbc.DataSourceFactory │ │ ├── logback.xml │ │ └── spring │ │ │ ├── context.xml │ │ │ ├── database.xml │ │ │ └── service.xml │ └── webapp │ │ ├── WEB-INF │ │ ├── springmvc-servlet.xml │ │ └── web.xml │ │ ├── application.html │ │ ├── css │ │ ├── application.css │ │ ├── base.css │ │ ├── bootstrap-chosen.css │ │ ├── bootstrap-datetimepicker.min.css │ │ ├── bootstrap-select.min.css │ │ ├── bootstrap-table.css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-treeview.css │ │ ├── bootstrap.min.css │ │ ├── chosen-sprite.png │ │ ├── cpu-profiler.css │ │ ├── daterangepicker-1.3.7.css │ │ ├── daterangepicker-bs3.css │ │ ├── daterangepicker.css │ │ ├── debug.css │ │ ├── header.css │ │ ├── help.less │ │ ├── images │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ └── ui-icons_ffffff_256x240.png │ │ ├── jquery-ui.min.css │ │ ├── jquery-ui.structure.min.css │ │ ├── jquery-ui.theme.min.css │ │ ├── jstack-dump.css │ │ ├── jstree │ │ │ ├── 32px.png │ │ │ ├── 40px.png │ │ │ ├── style.min.css │ │ │ └── throbber.gif │ │ ├── katex.min.css │ │ ├── main.css │ │ ├── menu.css │ │ ├── monitor.css │ │ ├── qconsole.css │ │ └── spop.min.css │ │ ├── debug.html │ │ ├── download.html │ │ ├── favicon.ico │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── help.html │ │ ├── help.md │ │ ├── highlight │ │ ├── CHANGES.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README.ru.md │ │ ├── highlight.pack.js │ │ └── styles │ │ │ ├── a11y-dark.css │ │ │ ├── a11y-light.css │ │ │ ├── agate.css │ │ │ ├── an-old-hope.css │ │ │ ├── androidstudio.css │ │ │ ├── arduino-light.css │ │ │ ├── arta.css │ │ │ ├── ascetic.css │ │ │ ├── atelier-cave-dark.css │ │ │ ├── atelier-cave-light.css │ │ │ ├── atelier-dune-dark.css │ │ │ ├── atelier-dune-light.css │ │ │ ├── atelier-estuary-dark.css │ │ │ ├── atelier-estuary-light.css │ │ │ ├── atelier-forest-dark.css │ │ │ ├── atelier-forest-light.css │ │ │ ├── atelier-heath-dark.css │ │ │ ├── atelier-heath-light.css │ │ │ ├── atelier-lakeside-dark.css │ │ │ ├── atelier-lakeside-light.css │ │ │ ├── atelier-plateau-dark.css │ │ │ ├── atelier-plateau-light.css │ │ │ ├── atelier-savanna-dark.css │ │ │ ├── atelier-savanna-light.css │ │ │ ├── atelier-seaside-dark.css │ │ │ ├── atelier-seaside-light.css │ │ │ ├── atelier-sulphurpool-dark.css │ │ │ ├── atelier-sulphurpool-light.css │ │ │ ├── atom-one-dark-reasonable.css │ │ │ ├── atom-one-dark.css │ │ │ ├── atom-one-light.css │ │ │ ├── brown-paper.css │ │ │ ├── brown-papersq.png │ │ │ ├── codepen-embed.css │ │ │ ├── color-brewer.css │ │ │ ├── darcula.css │ │ │ ├── dark.css │ │ │ ├── darkula.css │ │ │ ├── default.css │ │ │ ├── docco.css │ │ │ ├── dracula.css │ │ │ ├── far.css │ │ │ ├── foundation.css │ │ │ ├── github-gist.css │ │ │ ├── github.css │ │ │ ├── gml.css │ │ │ ├── googlecode.css │ │ │ ├── grayscale.css │ │ │ ├── gruvbox-dark.css │ │ │ ├── gruvbox-light.css │ │ │ ├── hopscotch.css │ │ │ ├── hybrid.css │ │ │ ├── idea.css │ │ │ ├── ir-black.css │ │ │ ├── isbl-editor-dark.css │ │ │ ├── isbl-editor-light.css │ │ │ ├── kimbie.dark.css │ │ │ ├── kimbie.light.css │ │ │ ├── lightfair.css │ │ │ ├── magula.css │ │ │ ├── mono-blue.css │ │ │ ├── monokai-sublime.css │ │ │ ├── monokai.css │ │ │ ├── nord.css │ │ │ ├── obsidian.css │ │ │ ├── ocean.css │ │ │ ├── paraiso-dark.css │ │ │ ├── paraiso-light.css │ │ │ ├── pojoaque.css │ │ │ ├── pojoaque.jpg │ │ │ ├── purebasic.css │ │ │ ├── qtcreator_dark.css │ │ │ ├── qtcreator_light.css │ │ │ ├── railscasts.css │ │ │ ├── rainbow.css │ │ │ ├── routeros.css │ │ │ ├── school-book.css │ │ │ ├── school-book.png │ │ │ ├── shades-of-purple.css │ │ │ ├── solarized-dark.css │ │ │ ├── solarized-light.css │ │ │ ├── sunburst.css │ │ │ ├── tomorrow-night-blue.css │ │ │ ├── tomorrow-night-bright.css │ │ │ ├── tomorrow-night-eighties.css │ │ │ ├── tomorrow-night.css │ │ │ ├── tomorrow.css │ │ │ ├── vs.css │ │ │ ├── vs2015.css │ │ │ ├── xcode.css │ │ │ ├── xt256.css │ │ │ └── zenburn.css │ │ ├── html │ │ ├── jstack-dump.html │ │ └── report.html │ │ ├── image │ │ └── tcdev.png │ │ ├── js │ │ ├── UUID.js │ │ ├── application.js │ │ ├── base64.js │ │ ├── bistoury.js │ │ ├── bootstrap-datetimepicker.min.js │ │ ├── bootstrap-select.min.js │ │ ├── bootstrap-table-zh-CN.js │ │ ├── bootstrap-table.js │ │ ├── bootstrap-treeview.js │ │ ├── bootstrap.min.js │ │ ├── chosen.jquery.js │ │ ├── daterangepicker-1.3.7.js │ │ ├── daterangepicker.min.js │ │ ├── debug.js │ │ ├── download.js │ │ ├── echarts.common.min.js │ │ ├── handlebars-v4.0.5.js │ │ ├── header.js │ │ ├── jqconsole.js │ │ ├── jqconsole.min.js │ │ ├── jquery-3.3.1.min.js │ │ ├── jquery-ui.min.js │ │ ├── jquery.cookie.js │ │ ├── jsencrypt.js │ │ ├── jstack-dump.js │ │ ├── jstree.min.js │ │ ├── machine.js │ │ ├── mode-ecb.js │ │ ├── moment-2.5.1.min.js │ │ ├── moment.min.js │ │ ├── monitor.js │ │ ├── profiler.js │ │ ├── qconsole.js │ │ ├── report.js │ │ ├── spop.min.js │ │ ├── tripledes.js │ │ ├── uploadimgs.js │ │ └── websocket.js │ │ ├── login.html │ │ ├── machine.html │ │ ├── moment.js │ │ ├── monitor.html │ │ ├── qconsole.html │ │ └── redirectError.html │ └── test │ ├── java │ └── qunar │ │ └── tc │ │ └── bistoury │ │ └── ui │ │ ├── container │ │ └── UiBootstrapForTest.java │ │ ├── controller │ │ └── DownloadFileControllerTest.java │ │ └── git │ │ ├── GithubTest.java │ │ └── github.http │ └── resources │ └── conf │ ├── config.properties │ ├── jdbc.properties │ ├── prometheus.properties │ ├── registry.properties │ ├── server.properties │ └── url_redirect.properties ├── docs ├── cn │ ├── FAQ.md │ ├── PID.md │ ├── application.md │ ├── commands.md │ ├── debug.md │ ├── deploy.md │ ├── design.md │ ├── design │ │ └── design.md │ ├── downloadFile.md │ ├── gitlab_maven.md │ ├── java11.md │ ├── jmap.md │ ├── jstack.md │ ├── monitor.md │ ├── profiler.md │ ├── quick_start.md │ ├── release.md │ └── store.md └── image │ ├── app_add.png │ ├── app_info.png │ ├── app_panel.png │ ├── app_server.png │ ├── app_server_manger.png │ ├── bistoury_qq_small.png │ ├── cannot_lib_class.png │ ├── console.png │ ├── debug-main.png │ ├── debug.png │ ├── debug_class_list.png │ ├── debug_panel.png │ ├── design.png │ ├── design │ ├── agent_connect_to_proxy.png │ ├── command_execute.png │ └── ui_choose_proxy.png │ ├── deug_panel.png │ ├── download.png │ ├── image-20210819175338181.png │ ├── image-20210819175409442.png │ ├── image-20210819175554861.png │ ├── jmap_panel.png │ ├── jstack.png │ ├── jstack_cpu_thread.png │ ├── jstack_entry.png │ ├── jstack_jmap_switch.png │ ├── jstack_panel.png │ ├── jstack_thread_search.png │ ├── jstack_thread_stacktrace.png │ ├── jvm.png │ ├── monitor.png │ ├── monitor_class_list.png │ ├── monitor_display.png │ ├── monitor_entry.png │ ├── monitor_panel.png │ ├── private_token.png │ ├── profiler_method.png │ ├── profiler_stack.png │ ├── profiler_start.png │ ├── profiler_start_step_2.png │ └── thread_dump.png ├── mvnw ├── mvnw.cmd ├── pom.xml └── script ├── build.sh ├── debug.sh ├── h2 ├── data.sql ├── h2-1.4.199.jar ├── h2.sh └── schema.sql ├── quick_start.sh └── quick_start_build.sh /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: If you would like to report a issue to Bistouryx, please use this template. 4 | 5 | 6 | --- 7 | 8 | - [ ] I have searched the [issues](https://github.com/xopencode/bistouryX/issues) of this repository and believe that this is not a duplicate. 9 | 10 | ### Ⅰ. Issue Description 11 | 12 | 13 | ### Ⅱ. Describe what happened 14 | 15 | If there is an exception, please attach the exception trace: 16 | 17 | ``` 18 | Just paste your stack trace here! 19 | ``` 20 | 21 | 22 | ### Ⅲ. Describe what you expected to happen 23 | 24 | 25 | ### Ⅳ. How to reproduce it (as minimally and precisely as possible) 26 | 27 | 1. xxx 28 | 2. xxx 29 | 3. xxx 30 | 31 | ### Ⅴ. Anything else we need to know? 32 | 33 | 34 | ### Ⅵ. Environment: 35 | 36 | - JDK version : 37 | - OS : 38 | - Others: -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for BistouryX 4 | 5 | --- 6 | 7 | ## Why you need it? 8 | Is your feature request related to a problem? Please describe in details 9 | 10 | 11 | ## How it could be? 12 | A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it. 13 | 14 | 15 | ## Other related information 16 | Add any other context or screenshots about the feature request here. 17 | 18 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Ⅰ. Describe what this PR did 4 | 5 | 6 | ### Ⅱ. Does this pull request fix one issue? 7 | 8 | 9 | 10 | ### Ⅲ. Why don't you add test cases (unit test/integration test)? 11 | 12 | 13 | ### Ⅳ. Describe how to verify it 14 | 15 | 16 | ### Ⅴ. Special notes for reviews 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # kdiff3 ignore 2 | *.orig 3 | 4 | # maven ignore 5 | target/ 6 | 7 | # eclipse ignore 8 | .settings/ 9 | .project 10 | .classpath 11 | classes/** 12 | 13 | # idea ignore 14 | .idea/ 15 | *.ipr 16 | *.iml 17 | *.iws 18 | 19 | # temp ignore 20 | *.log 21 | *.cache 22 | *.diff 23 | *.patch 24 | *.tmp 25 | 26 | # system ignore 27 | .DS_Store 28 | Thumbs.db 29 | 30 | # package ignore (optional) 31 | # *.jar 32 | # *.war 33 | # *.zip 34 | # *.tar 35 | # *.tar.gz 36 | 37 | # embedded tomcat 38 | tomcat.8080/** 39 | 40 | # pods ignore 41 | Pods/ 42 | 43 | bistoury-*.tar.gz 44 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/job/ContinueResponseJob.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.agent.common.job; 2 | 3 | import com.google.common.util.concurrent.ListeningExecutorService; 4 | 5 | /** 6 | * @author zhenyu.nie created on 2019 2019/10/16 19:20 7 | */ 8 | public interface ContinueResponseJob { 9 | 10 | String getId(); 11 | 12 | void init() throws Exception; 13 | 14 | boolean doResponse() throws Exception; 15 | 16 | void clear(); 17 | 18 | void finish() throws Exception; 19 | 20 | void error(Throwable t); 21 | 22 | void cancel(); 23 | 24 | ListeningExecutorService getExecutor(); 25 | } 26 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/job/ResponseJobStore.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.agent.common.job; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/16 17:57 5 | */ 6 | public interface ResponseJobStore { 7 | 8 | void setWritable(boolean writable); 9 | 10 | void submit(ContinueResponseJob job); 11 | 12 | void pause(String id); 13 | 14 | void resume(String id); 15 | 16 | void stop(String id); 17 | 18 | void close(); 19 | } 20 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/kv/KvDb.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.common.kv; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2019 2019/1/8 17:20 24 | */ 25 | public interface KvDb { 26 | 27 | String get(String key); 28 | 29 | void put(String key, String value); 30 | 31 | void putBatch(Map data); 32 | } 33 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/kv/KvDbs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.common.kv; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/1/8 19:16 22 | */ 23 | public class KvDbs { 24 | 25 | private static final KvDb kvDb; 26 | 27 | static { 28 | kvDb = new KvDbWrapper(); 29 | } 30 | 31 | public static KvDb getKvDb() { 32 | return kvDb; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/pid/PidHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.common.pid; 19 | 20 | /** 21 | * @author: leix.xie 22 | * @date: 2019/3/13 17:14 23 | * @describe: 24 | */ 25 | public interface PidHandler { 26 | 27 | int priority(); 28 | 29 | int getPid(); 30 | } 31 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/pid/PidHandlerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.common.pid; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/7/24 15:20 22 | */ 23 | public interface PidHandlerFactory { 24 | 25 | PidHandler create(); 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/main/java/qunar/tc/bistoury/agent/common/task/AgentGlobalTaskFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.common.task; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/1/8 17:13 22 | */ 23 | public interface AgentGlobalTaskFactory { 24 | 25 | void start(); 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-agent-common/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [%d{yyyy-MM-dd HH:mm:ss:SSS} QTraceId[%X{qtraceid}] [%thread] %5p %c:%L] %m%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /bistoury-agent-task/src/main/java/qunar/tc/bistoury/agent/task/cpujstack/PidExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.task.cpujstack; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/1/10 13:50 22 | */ 23 | public interface PidExecutor { 24 | 25 | String execute(int pid); 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-agent-task/src/main/java/qunar/tc/bistoury/agent/task/cpujstack/PidRecordExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.agent.task.cpujstack; 19 | 20 | import com.google.common.util.concurrent.ListenableFuture; 21 | 22 | import java.util.Map; 23 | 24 | /** 25 | * @author cai.wen 26 | */ 27 | public interface PidRecordExecutor { 28 | 29 | ListenableFuture> execute(int pid); 30 | } 31 | -------------------------------------------------------------------------------- /bistoury-agent-task/src/main/java/qunar/tc/bistoury/agent/task/profiler/ProfilerFileCleanTaskFactory.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.agent.task.profiler; 2 | 3 | import qunar.tc.bistoury.agent.common.task.AgentGlobalTaskFactory; 4 | import qunar.tc.bistoury.common.NamedThreadFactory; 5 | 6 | import java.util.concurrent.Executors; 7 | import java.util.concurrent.ScheduledExecutorService; 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * @author cai.wen created on 19-11-28 下午5:25 12 | */ 13 | public class ProfilerFileCleanTaskFactory implements AgentGlobalTaskFactory { 14 | 15 | private static final ScheduledExecutorService executor = 16 | Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("profiler-file-clean-task", true)); 17 | 18 | @Override 19 | public void start() { 20 | executor.scheduleAtFixedRate(new TaskRunner(), 0, 1, TimeUnit.DAYS); 21 | } 22 | } -------------------------------------------------------------------------------- /bistoury-agent-task/src/main/resources/META-INF/services/qunar.tc.bistoury.agent.common.task.AgentGlobalTaskFactory: -------------------------------------------------------------------------------- 1 | qunar.tc.bistoury.agent.task.monitor.MonitorReportTaskFactory 2 | qunar.tc.bistoury.agent.task.cpujstack.CpuJStackTaskFactory 3 | qunar.tc.bistoury.agent.task.agentInfo.AgentInfoPushTaskFactory 4 | qunar.tc.bistoury.agent.task.heapHisto.HeapHistoDumpTaskFactory 5 | qunar.tc.bistoury.agent.task.profiler.ProfilerFileCleanTaskFactory -------------------------------------------------------------------------------- /bistoury-agent-task/src/test/java/qunar/tc/bistoury/agent/task/proc/InfoParserTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.agent.task.proc; 2 | 3 | import com.google.common.base.Charsets; 4 | import com.google.common.base.Joiner; 5 | import com.google.common.base.Splitter; 6 | import com.google.common.io.Files; 7 | import org.junit.Test; 8 | 9 | import java.io.File; 10 | import java.io.IOException; 11 | 12 | /** 13 | * Created by cai.wen on 19-1-18. 14 | */ 15 | public class InfoParserTest { 16 | int pid = 3172; 17 | 18 | @Test 19 | public void cmdLine() throws IOException { 20 | File cmdLineFile = new File("/proc/" + pid, "cmdline"); 21 | Splitter splitter = Splitter.on("\0"); 22 | Joiner joiner = Joiner.on(" "); 23 | System.out.println(joiner.join(splitter.splitToList(Files.toString(cmdLineFile, Charsets.UTF_8)))); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bistoury-agent-task/src/test/java/qunar/tc/bistoury/agent/task/proc/StatParserTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.agent.task.proc; 2 | 3 | 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * @author cai.wen 10 | * @date 19-1-17 11 | */ 12 | public class StatParserTest { 13 | @Test 14 | public void testParser() throws IOException { 15 | System.out.println(StatParser.getInstance().parseCpuInfo()); 16 | System.out.println(StatParser.getInstance().parseProcessInfo(3552)); 17 | System.out.println(StatParser.getInstance().parseThreadInfo(3552, 22715)); 18 | System.out.println(StatParser.getInstance().parseThreadInfo(3552, 22445)); 19 | System.out.println(StatParser.getInstance().parseThreadInfo(3552, 3566)); 20 | System.out.println(StatParser.getInstance().parseThreadInfo(3552, 3638)); 21 | } 22 | 23 | @Test 24 | public void formatInfo() { 25 | System.out.println(ProcUtil.formatJiffies(10000001)); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-application/bistoury-application-api/src/main/java/qunar/tc/bistoury/application/api/AdminAppService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.application.api; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * @author cai.wen 24 | * @date 19-4-19 25 | */ 26 | public interface AdminAppService { 27 | 28 | List searchApps(String searchKey, int size); 29 | } 30 | -------------------------------------------------------------------------------- /bistoury-application/bistoury-application-api/src/main/java/qunar/tc/bistoury/application/api/AppService.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.application.api; 2 | 3 | import java.util.Set; 4 | 5 | import qunar.tc.bistoury.application.api.pojo.Application; 6 | 7 | /** 8 | * @author xkrivzooh 9 | * @since 2019/8/14 10 | */ 11 | public interface AppService { 12 | 13 | Set getApps(String userCode); 14 | 15 | Application getAppInfo(String appCode); 16 | 17 | boolean checkUserPermission(String appCode, String usercode); 18 | } 19 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/debug/RemoveListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.attach.arthas.debug; 19 | 20 | import qunar.tc.bistoury.common.Snapshot; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2018 2018/11/29 14:19 24 | */ 25 | public interface RemoveListener { 26 | 27 | void remove(String breakpointId, Snapshot snapshot); 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/debug/SizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.attach.arthas.debug; 19 | 20 | import java.io.IOException; 21 | 22 | /** 23 | * Created by cai.wen on 18-12-12. 24 | */ 25 | public class SizeLimitExceededException extends IOException { 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/debug/SnapshotCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.attach.arthas.debug; 19 | 20 | import qunar.tc.bistoury.common.Snapshot; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2018 2018/9/21 17:00 24 | */ 25 | public interface SnapshotCache { 26 | 27 | Snapshot getSnapshot(String id); 28 | 29 | void remove(String id); 30 | } 31 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/debug/SnapshotStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.attach.arthas.debug; 19 | 20 | import qunar.tc.bistoury.instrument.client.debugger.SnapshotReceiver; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2018 2018/11/29 17:27 24 | */ 25 | public interface SnapshotStore extends SnapshotReceiver, SnapshotCache { 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/instrument/InstrumentClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.attach.arthas.instrument; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/2/18 14:33 22 | */ 23 | public interface InstrumentClient { 24 | 25 | void destroy(); 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/profiler/GProfilerClients.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.attach.arthas.profiler; 2 | 3 | import java.util.concurrent.atomic.AtomicBoolean; 4 | 5 | /** 6 | * @author zhenyu.nie created on 2019 2019/12/31 17:35 7 | */ 8 | public class GProfilerClients { 9 | 10 | private static volatile GProfilerClient client; 11 | 12 | private static AtomicBoolean init = new AtomicBoolean(false); 13 | 14 | public static GProfilerClient getInstance() { 15 | if (client != null) { 16 | return client; 17 | } else { 18 | throw new IllegalStateException("profiler client not available"); 19 | } 20 | } 21 | 22 | public static GProfilerClient create() { 23 | if (init.compareAndSet(false, true)) { 24 | client = new GProfilerClient(); 25 | return client; 26 | } else { 27 | throw new IllegalStateException("profiler client already created"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/server/QStopCommand.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.attach.arthas.server; 2 | 3 | import com.taobao.arthas.core.shell.command.AnnotatedCommand; 4 | import com.taobao.arthas.core.shell.command.CommandProcess; 5 | import com.taobao.middleware.cli.annotations.Name; 6 | import com.taobao.middleware.cli.annotations.Summary; 7 | import qunar.tc.bistoury.common.BistouryConstants; 8 | 9 | /** 10 | * @author leix.xie 11 | * @date 2019/9/23 19:31 12 | * @describe 13 | */ 14 | @Name(BistouryConstants.STOP_COMMAND) 15 | @Summary("Stop/Shutdown Arthas server and exit the console. Alias for shutdown.") 16 | public class QStopCommand extends AnnotatedCommand { 17 | @Override 18 | public void process(CommandProcess process) { 19 | QShutdownCommand.shutdown(process); 20 | } 21 | } -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/java/qunar/tc/bistoury/attach/arthas/util/TypeResponseResult.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.attach.arthas.util; 2 | 3 | import qunar.tc.bistoury.common.CodeProcessResponse; 4 | import qunar.tc.bistoury.common.TypeResponse; 5 | 6 | /** 7 | * @author cai.wen created on 2019/11/5 14:40 8 | */ 9 | public class TypeResponseResult { 10 | 11 | public static TypeResponse create(T t, String type) { 12 | CodeProcessResponse response = new CodeProcessResponse<>(); 13 | TypeResponse typeResponse = new TypeResponse<>(); 14 | typeResponse.setType(type); 15 | typeResponse.setData(response); 16 | response.setData(t); 17 | return typeResponse; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/test/qunar/tc/bistory/BitTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistory; 2 | 3 | /** 4 | * @author: leix.xie 5 | * @date: 2019/3/29 10:34 6 | * @describe: 7 | */ 8 | public class BitTest { 9 | /** 10 | * 主方法 11 | */ 12 | public static void main(String[] args) { 13 | System.out.println(7 & 4); 14 | System.out.println(7 & 2); 15 | System.out.println(7 & 1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /bistoury-attach-arthas/src/main/test/qunar/tc/bistory/Test.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistory; 2 | 3 | import java.util.Random; 4 | 5 | /** 6 | * @author: leix.xie 7 | * @date: 2018/12/28 15:45 8 | * @describe: 9 | */ 10 | public class Test { 11 | /** 12 | * 主方法 13 | */ 14 | public static void main(String[] args) { 15 | for (int i = 0; ; i++) { 16 | test(i); 17 | } 18 | } 19 | 20 | public static void test(int index) { 21 | try { 22 | Thread.sleep(new Random().nextInt(1000)); 23 | System.out.println(index); 24 | } catch (InterruptedException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-attach-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | bistoury 7 | qunar.tc.bistoury 8 | 2.0.7 9 | 10 | 4.0.0 11 | 12 | bistoury-attach-common 13 | jar 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | qunar.tc.bistoury 22 | bistoury-clientside-common 23 | 24 | 25 | com.taobao.middleware 26 | logger.core 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /bistoury-attach-common/src/main/java/qunar/tc/bistoury/attach/common/BistouryLoggerHelper.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.attach.common; 2 | 3 | import com.taobao.middleware.logger.util.MessageUtil; 4 | 5 | /** 6 | * @author cai.wen created on 2019/11/5 15:24 7 | */ 8 | public class BistouryLoggerHelper { 9 | 10 | public static String formatMessage(String formatText, Object... args) { 11 | return MessageUtil.formatMessage(formatText, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bistoury-clientside-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | bistoury 7 | qunar.tc.bistoury 8 | 2.0.7 9 | 10 | 4.0.0 11 | 12 | bistoury-clientside-common 13 | jar 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | qunar.tc.bistoury 22 | bistoury-common 23 | 24 | 25 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/CommunicateUtil.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands.arthas.telnet; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/12 16:53 5 | */ 6 | public class CommunicateUtil { 7 | 8 | public static final byte[] PROMPT_PREFIX = new byte[] { '[', 'a', 'r', 't', 'h', 'a', 's', '@' }; 9 | 10 | public static final byte[] PROMPT_SUFFIX = new byte[] { ']', '$' }; 11 | 12 | public static final int MIN_PID_LENGTH = 1; 13 | 14 | public static final int MAX_PID_LENGTH = 5; 15 | 16 | public static final int MIN_PROMPT_LENGTH = PROMPT_PREFIX.length + MIN_PID_LENGTH + PROMPT_SUFFIX.length; 17 | 18 | public static final int MAX_PROMPT_LENGTH = PROMPT_PREFIX.length + MAX_PID_LENGTH + PROMPT_SUFFIX.length; 19 | 20 | public static final int DEFAULT_BUFFER_SIZE = 4 * 1024; 21 | 22 | public static final byte LAST_PROMPT_BYTE = '$'; 23 | 24 | public static final String LAST_PROMPT_STR = "$"; 25 | } 26 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/IllegalVersionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.commands.arthas.telnet; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2018 2018/12/1 20:13 22 | */ 23 | public class IllegalVersionException extends RuntimeException { 24 | } 25 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/PromptProcessor.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands.arthas.telnet; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/11 17:06 5 | */ 6 | class PromptProcessor implements ResultProcessor { 7 | 8 | private final PromptBufData promptBuf = new PromptBufData(); 9 | 10 | private final Writer writer; 11 | 12 | public PromptProcessor(Writer writer) { 13 | this.writer = writer; 14 | } 15 | 16 | @Override 17 | public boolean process(byte[] input, int start, int count) { 18 | CompositeBytes bytes = new CompositeBytes(writer, promptBuf, input, start, count); 19 | boolean end = bytes.hasPrompt(); 20 | bytes.write(); 21 | return end; 22 | } 23 | } -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/ResultProcessor.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands.arthas.telnet; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/11 17:05 5 | */ 6 | interface ResultProcessor { 7 | 8 | boolean process(byte[] input, int start, int count); 9 | } 10 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/SkipFirstLineProcessor.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands.arthas.telnet; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/14 13:54 5 | */ 6 | class SkipFirstLineProcessor implements ResultProcessor { 7 | 8 | private final ResultProcessor delegate; 9 | 10 | private boolean alreadySkip = false; 11 | 12 | SkipFirstLineProcessor(ResultProcessor delegate) { 13 | this.delegate = delegate; 14 | } 15 | 16 | @Override 17 | public boolean process(byte[] input, int start, int count) { 18 | if (alreadySkip) { 19 | return delegate.process(input, start, count); 20 | } else { 21 | int i = start; 22 | int end = start + count; 23 | while (i < end) { 24 | if (input[i] == '\n') { 25 | alreadySkip = true; 26 | if (i + 1 < end) { 27 | return delegate.process(input, i + 1, end - i - 1); 28 | } 29 | } 30 | ++i; 31 | } 32 | return false; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/Telnet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.commands.arthas.telnet; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2018 2018/10/15 19:01 22 | */ 23 | public interface Telnet { 24 | 25 | void write(String command) throws Exception; 26 | 27 | String getVersion(); 28 | 29 | byte[] read() throws Exception; 30 | 31 | void close(); 32 | } 33 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/TelnetStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.commands.arthas.telnet; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2018 2018/10/15 19:00 22 | */ 23 | public interface TelnetStore { 24 | 25 | Telnet getTelnet(int pid) throws Exception; 26 | 27 | Telnet tryGetTelnet() throws Exception; 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/arthas/telnet/Writer.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands.arthas.telnet; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/11 17:07 5 | */ 6 | interface Writer { 7 | 8 | void write(byte[] data); 9 | } 10 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/java/qunar/tc/bistoury/commands/download/DownloadFileListTaskFactory.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands.download; 2 | 3 | import com.google.common.collect.ImmutableSet; 4 | import qunar.tc.bistoury.agent.common.ResponseHandler; 5 | import qunar.tc.bistoury.remoting.netty.Task; 6 | import qunar.tc.bistoury.remoting.netty.TaskFactory; 7 | import qunar.tc.bistoury.remoting.protocol.CommandCode; 8 | import qunar.tc.bistoury.remoting.protocol.RemotingHeader; 9 | 10 | import java.util.Set; 11 | 12 | /** 13 | * @author leix.xie 14 | * @date 2019/11/4 16:23 15 | * @describe 16 | */ 17 | public class DownloadFileListTaskFactory implements TaskFactory { 18 | @Override 19 | public Set codes() { 20 | return ImmutableSet.of(CommandCode.REQ_TYPE_LIST_DOWNLOAD_FILE.getCode()); 21 | } 22 | 23 | @Override 24 | public String name() { 25 | return "list download file"; 26 | } 27 | 28 | @Override 29 | public Task create(RemotingHeader header, String command, ResponseHandler handler) { 30 | return new DownloadFileListTask(header.getId(), command, handler, header.getMaxRunningMs()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bistoury-commands/src/main/resources/META-INF/services/qunar.tc.bistoury.remoting.netty.TaskFactory: -------------------------------------------------------------------------------- 1 | qunar.tc.bistoury.commands.arthas.ArthasTaskFactory 2 | qunar.tc.bistoury.commands.JdkProcessCmdTaskFactory 3 | qunar.tc.bistoury.commands.host.HostTaskFactory 4 | qunar.tc.bistoury.commands.host.ThreadInfoTaskFactory 5 | qunar.tc.bistoury.commands.heapHisto.HeapHistoTaskFactory 6 | qunar.tc.bistoury.commands.monitor.QMonitorQueryTaskFactory 7 | qunar.tc.bistoury.commands.cpujstack.CpuTimeTaskFactory 8 | qunar.tc.bistoury.commands.cpujstack.ThreadInfoTaskFactory 9 | qunar.tc.bistoury.commands.cpujstack.ThreadNumTaskFactory 10 | qunar.tc.bistoury.commands.decompiler.DecompilerTaskFactory 11 | qunar.tc.bistoury.commands.profiler.ProfilerFileForProxyTaskFactory 12 | qunar.tc.bistoury.commands.download.DownloadFileListTaskFactory 13 | qunar.tc.bistoury.commands.download.DownloadFileTaskFactory -------------------------------------------------------------------------------- /bistoury-commands/src/test/java/VMTest.java: -------------------------------------------------------------------------------- 1 | import java.io.File; 2 | import java.io.FileInputStream; 3 | 4 | /** 5 | * @author: leix.xie 6 | * @date: 2018/12/3 20:18 7 | * @describe: 8 | */ 9 | public class VMTest { 10 | /** 11 | * 主方法 12 | */ 13 | public static void main(String[] args) throws Exception { 14 | long start = System.currentTimeMillis(); 15 | File file = new File("C:\\Users\\leixie\\.IntelliJIdea2018.2\\system\\tomcat\\Unnamed_realtimelogviewer\\logs\\gc.log"); 16 | FileInputStream inputStream = new FileInputStream(file); 17 | byte[] buffer = new byte[10240]; 18 | int readBytesCount = inputStream.read(buffer); 19 | while (readBytesCount > -1) { 20 | readBytesCount = inputStream.read(buffer); 21 | } 22 | System.out.println(System.currentTimeMillis() - start); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bistoury-commands/src/test/java/qunar/tc/bistoury/commands/CPULoadAverages.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * @author: leix.xie 7 | * @date: 2018/11/16 17:54 8 | * @describe: 9 | */ 10 | public class CPULoadAverages { 11 | /** 12 | * 主方法 13 | */ 14 | public static void main(String[] args) throws Exception { 15 | Process process = Runtime.getRuntime().exec("cat /proc/loadavg"); 16 | InputStream is = process.getInputStream(); 17 | byte[] bytes = new byte[256]; 18 | int read = is.read(bytes); 19 | byte[] result = new byte[read]; 20 | System.arraycopy(bytes, 0, result, 0, read-1); 21 | System.out.println(new String(result).substring(0,read-1)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bistoury-commands/src/test/java/qunar/tc/bistoury/commands/StringFormatTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands; 2 | 3 | import java.text.MessageFormat; 4 | 5 | /** 6 | * @author leix.xie 7 | * @date 2019/7/10 16:26 8 | * @describe 9 | */ 10 | public class StringFormatTest { 11 | public static void main(String[] args) { 12 | String str = "http://www.example.com/nexus/content/groups/public/{0}/{1}/{2}/{1}-{2}-sources.jar"; 13 | String groupId = "qunar/tc"; 14 | String artifactId = "qmq-client"; 15 | String version = "4.1.7"; 16 | System.out.println(MessageFormat.format(str, groupId, artifactId, version)); 17 | } 18 | } -------------------------------------------------------------------------------- /bistoury-commands/src/test/java/qunar/tc/bistoury/commands/ThreadDumpTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.commands; 2 | 3 | import java.lang.management.ManagementFactory; 4 | import java.lang.management.ThreadInfo; 5 | import java.lang.management.ThreadMXBean; 6 | 7 | /** 8 | * @author: leix.xie 9 | * @date: 2018/11/20 21:30 10 | * @describe: 11 | */ 12 | public class ThreadDumpTest { 13 | /** 14 | * 主方法 15 | */ 16 | public static void main(String[] args) throws Exception { 17 | ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); 18 | long[] ids = threadMXBean.getAllThreadIds(); 19 | ThreadInfo[] threadInfo = threadMXBean.getThreadInfo(ids); 20 | for (ThreadInfo info : threadInfo) { 21 | System.out.println(info.getThreadId() + "\t" + info.getThreadState() + "\t" + info.getThreadName()+"\t"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bistoury-common/src/main/java/qunar/tc/bistoury/common/ProfilerUtil.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.common; 2 | 3 | import com.google.common.base.Optional; 4 | 5 | import java.io.File; 6 | import java.io.FilenameFilter; 7 | 8 | /** 9 | * @author cai.wen created on 2019/11/6 13:11 10 | */ 11 | public class ProfilerUtil { 12 | 13 | public static final String RUNNING_STATUS = "running"; 14 | 15 | public static final String FINISH_STATUS = "finish"; 16 | 17 | public static final String ERROR_STATUS = "error"; 18 | 19 | public static Optional getProfilerDir(String rootDir, final String profilerId) { 20 | File root = new File(rootDir); 21 | File[] children = root.listFiles(new FilenameFilter() { 22 | @Override 23 | public boolean accept(File dir, String name) { 24 | return name.startsWith(profilerId); 25 | } 26 | }); 27 | if (children == null || children.length == 0) { 28 | return Optional.absent(); 29 | } 30 | return Optional.of(children[0]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bistoury-common/src/main/java/qunar/tc/bistoury/common/Status.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.common; 19 | 20 | /** 21 | * @author: leix.xie 22 | * @date: 2018/12/28 14:19 23 | * @describe: 24 | */ 25 | public enum Status { 26 | notStart, started, error, closed 27 | } -------------------------------------------------------------------------------- /bistoury-common/src/main/java/qunar/tc/bistoury/common/profiler/compact/TrieNode.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.common.profiler.compact; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | class TrieNode { 7 | 8 | private final Map children = new HashMap<>(); 9 | private boolean endOfWord; 10 | 11 | Map getChildren() { 12 | return children; 13 | } 14 | 15 | boolean isEndOfWord() { 16 | return endOfWord; 17 | } 18 | 19 | void setEndOfWord(boolean endOfWord) { 20 | this.endOfWord = endOfWord; 21 | } 22 | 23 | void addChild(char childChar, TrieNode trieNode) { 24 | children.put(childChar, trieNode); 25 | } 26 | } -------------------------------------------------------------------------------- /bistoury-common/src/main/java/qunar/tc/bistoury/common/profiler/method/FunctionInfo.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.common.profiler.method; 2 | 3 | import java.util.Objects; 4 | 5 | /** 6 | * @author cai.wen created on 19-12-2 上午8:55 7 | */ 8 | public class FunctionInfo { 9 | 10 | private final String funcName; 11 | 12 | public FunctionInfo(String funcName) { 13 | this.funcName = funcName; 14 | } 15 | 16 | public String getFuncName() { 17 | return funcName; 18 | } 19 | 20 | @Override 21 | public boolean equals(Object o) { 22 | if (this == o) return true; 23 | if (o == null || getClass() != o.getClass()) return false; 24 | FunctionInfo that = (FunctionInfo) o; 25 | return Objects.equals(funcName, that.funcName); 26 | } 27 | 28 | @Override 29 | public int hashCode() { 30 | return Objects.hash(funcName); 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return "FunctionInfo{" + 36 | "funcName='" + funcName + '\'' + 37 | '}'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/README.md: -------------------------------------------------------------------------------- 1 | 使用JetBrains的intellij-community中的反编译引擎`fernflower`,版本为`3e1257459560a5b3c7ba67096347eb67302eabf0`。 2 | github: [fernflower](https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine) 3 | 4 | change list: 5 | - 修改了报名 6 | - 在org.jetbrains.java.decompiler.main.Fernflower添加addStream方法,提供按照文件流反编译的接口 -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | bistoury 7 | qunar.tc.bistoury 8 | 2.0.7 9 | 10 | 4.0.0 11 | 12 | bistoury-decompiler-fernflower 13 | 14 | 15 | 16 | qunar.tc.bistoury 17 | bistoury-common 18 | 19 | 20 | 21 | junit 22 | junit-dep 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/code/ExceptionHandler.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.code; 3 | 4 | import qunar.tc.decompiler.main.DecompilerContext; 5 | 6 | public class ExceptionHandler { 7 | public int from = 0; 8 | public int to = 0; 9 | public int handler = 0; 10 | 11 | public int from_instr = 0; 12 | public int to_instr = 0; 13 | public int handler_instr = 0; 14 | 15 | public String exceptionClass = null; 16 | 17 | public String toString() { 18 | String new_line_separator = DecompilerContext.getNewLineSeparator(); 19 | return "from: " + from + " to: " + to + " handler: " + handler + new_line_separator + 20 | "from_instr: " + from_instr + " to_instr: " + to_instr + " handler_instr: " + handler_instr + new_line_separator + 21 | "exceptionClass: " + exceptionClass + new_line_separator; 22 | } 23 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/code/ExceptionTable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.code; 3 | 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | public class ExceptionTable { 8 | public static final ExceptionTable EMPTY = new ExceptionTable(Collections.emptyList()); 9 | 10 | private final List handlers; 11 | 12 | public ExceptionTable(List handlers) { 13 | this.handlers = handlers; 14 | } 15 | 16 | public List getHandlers() { 17 | return handlers; 18 | } 19 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/code/JumpInstruction.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.code; 3 | 4 | public class JumpInstruction extends Instruction { 5 | public int destination; 6 | 7 | public JumpInstruction(int opcode, int group, boolean wide, int bytecodeVersion, int[] operands) { 8 | super(opcode, group, wide, bytecodeVersion, operands); 9 | } 10 | 11 | @Override 12 | public void initInstruction(InstructionSequence seq) { 13 | destination = seq.getPointerByRelOffset(this.operand(0)); 14 | } 15 | 16 | @Override 17 | public JumpInstruction clone() { 18 | JumpInstruction copy = (JumpInstruction) super.clone(); 19 | copy.destination = destination; 20 | return copy; 21 | } 22 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/code/SimpleInstructionSequence.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.code; 3 | 4 | import qunar.tc.decompiler.util.VBStyleCollection; 5 | 6 | public class SimpleInstructionSequence extends InstructionSequence { 7 | 8 | public SimpleInstructionSequence() { 9 | } 10 | 11 | public SimpleInstructionSequence(VBStyleCollection collinstr) { 12 | super(collinstr); 13 | } 14 | 15 | @Override 16 | public SimpleInstructionSequence clone() { 17 | SimpleInstructionSequence newseq = new SimpleInstructionSequence(collinstr.clone()); 18 | newseq.setPointer(this.getPointer()); 19 | 20 | return newseq; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/main/collectors/CounterContainer.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.main.collectors; 3 | 4 | public class CounterContainer { 5 | public static final int STATEMENT_COUNTER = 0; 6 | public static final int EXPRESSION_COUNTER = 1; 7 | public static final int VAR_COUNTER = 2; 8 | 9 | private final int[] values = new int[]{1, 1, 1}; 10 | 11 | public void setCounter(int counter, int value) { 12 | values[counter] = value; 13 | } 14 | 15 | public int getCounter(int counter) { 16 | return values[counter]; 17 | } 18 | 19 | public int getCounterAndIncrement(int counter) { 20 | return values[counter]++; 21 | } 22 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/main/collectors/VarNamesCollector.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.main.collectors; 3 | 4 | import java.util.Collection; 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | public class VarNamesCollector { 9 | 10 | private final Set usedNames = new HashSet<>(); 11 | 12 | public VarNamesCollector() { 13 | } 14 | 15 | public VarNamesCollector(Collection setNames) { 16 | usedNames.addAll(setNames); 17 | } 18 | 19 | public void addName(String value) { 20 | usedNames.add(value); 21 | } 22 | 23 | public String getFreeName(int index) { 24 | return getFreeName("var" + index); 25 | } 26 | 27 | public String getFreeName(String proposition) { 28 | while (usedNames.contains(proposition)) { 29 | proposition += "x"; 30 | } 31 | usedNames.add(proposition); 32 | return proposition; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/main/extern/IBytecodeProvider.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.main.extern; 3 | 4 | import java.io.IOException; 5 | 6 | public interface IBytecodeProvider { 7 | byte[] getBytecode(String externalPath, String internalPath) throws IOException; 8 | } 9 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/main/extern/IIdentifierRenamer.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.main.extern; 3 | 4 | public interface IIdentifierRenamer { 5 | 6 | enum Type {ELEMENT_CLASS, ELEMENT_FIELD, ELEMENT_METHOD} 7 | 8 | boolean toBeRenamed(Type elementType, String className, String element, String descriptor); 9 | 10 | String getNextClassName(String fullName, String shortName); 11 | 12 | String getNextFieldName(String className, String field, String descriptor); 13 | 14 | String getNextMethodName(String className, String method, String descriptor); 15 | } 16 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/main/extern/IResultSaver.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.main.extern; 3 | 4 | import java.util.jar.Manifest; 5 | 6 | public interface IResultSaver { 7 | void saveFolder(String path); 8 | 9 | void copyFile(String source, String path, String entryName); 10 | 11 | void saveClassFile(String path, String qualifiedName, String entryName, String content, int[] mapping); 12 | 13 | void createArchive(String path, String archiveName, Manifest manifest); 14 | 15 | void saveDirEntry(String path, String archiveName, String entryName); 16 | 17 | void copyEntry(String source, String path, String archiveName, String entry); 18 | 19 | void saveClassEntry(String path, String archiveName, String qualifiedName, String entryName, String content); 20 | 21 | void closeArchive(String path, String archiveName); 22 | } 23 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/decompiler/ClearStructHelper.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.decompiler; 3 | 4 | import qunar.tc.decompiler.modules.decompiler.stats.RootStatement; 5 | import qunar.tc.decompiler.modules.decompiler.stats.Statement; 6 | 7 | import java.util.LinkedList; 8 | 9 | 10 | public class ClearStructHelper { 11 | 12 | public static void clearStatements(RootStatement root) { 13 | 14 | LinkedList stack = new LinkedList<>(); 15 | stack.add(root); 16 | 17 | while (!stack.isEmpty()) { 18 | 19 | Statement stat = stack.removeFirst(); 20 | 21 | stat.clearTempInformation(); 22 | 23 | stack.addAll(stat.getStats()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/decompiler/ExprentStack.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.decompiler; 3 | 4 | import qunar.tc.decompiler.modules.decompiler.exps.Exprent; 5 | import qunar.tc.decompiler.util.ListStack; 6 | 7 | public class ExprentStack extends ListStack { 8 | 9 | public ExprentStack() { 10 | } 11 | 12 | public ExprentStack(ListStack list) { 13 | super(list); 14 | pointer = list.getPointer(); 15 | } 16 | 17 | @Override 18 | public Exprent pop() { 19 | 20 | return this.remove(--pointer); 21 | } 22 | 23 | @Override 24 | public ExprentStack clone() { 25 | return new ExprentStack(this); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/decompiler/PrimitiveExprsList.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.decompiler; 3 | 4 | import qunar.tc.decompiler.modules.decompiler.exps.Exprent; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class PrimitiveExprsList { 10 | 11 | private final List lstExprents = new ArrayList<>(); 12 | 13 | private ExprentStack stack = new ExprentStack(); 14 | 15 | public PrimitiveExprsList() { 16 | } 17 | 18 | public PrimitiveExprsList copyStack() { 19 | PrimitiveExprsList prlst = new PrimitiveExprsList(); 20 | prlst.setStack(stack.clone()); 21 | return prlst; 22 | } 23 | 24 | public List getLstExprents() { 25 | return lstExprents; 26 | } 27 | 28 | public ExprentStack getStack() { 29 | return stack; 30 | } 31 | 32 | public void setStack(ExprentStack stack) { 33 | this.stack = stack; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/decompiler/decompose/IGraph.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.decompiler.decompose; 3 | 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | public interface IGraph { 8 | 9 | List getReversePostOrderList(); 10 | 11 | Set getRoots(); 12 | } 13 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/decompiler/decompose/IGraphNode.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.decompiler.decompose; 3 | 4 | import java.util.List; 5 | 6 | public interface IGraphNode { 7 | 8 | List getPredecessors(); 9 | } 10 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/decompiler/stats/DummyExitStatement.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.decompiler.stats; 3 | 4 | import java.util.Collection; 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | /** 9 | * @author egor 10 | */ 11 | public class DummyExitStatement extends Statement { 12 | public Set bytecode = null; // offsets of bytecode instructions mapped to dummy exit 13 | 14 | public DummyExitStatement() { 15 | type = Statement.TYPE_DUMMYEXIT; 16 | } 17 | 18 | public void addBytecodeOffsets(Collection bytecodeOffsets) { 19 | if (bytecodeOffsets != null && !bytecodeOffsets.isEmpty()) { 20 | if (bytecode == null) { 21 | bytecode = new HashSet<>(bytecodeOffsets); 22 | } else { 23 | bytecode.addAll(bytecodeOffsets); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/renamer/ClassWrapperNode.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.renamer; 3 | 4 | import qunar.tc.decompiler.struct.StructClass; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class ClassWrapperNode { 10 | private final StructClass classStruct; 11 | private final List subclasses = new ArrayList<>(); 12 | 13 | public ClassWrapperNode(StructClass cl) { 14 | this.classStruct = cl; 15 | } 16 | 17 | public void addSubclass(ClassWrapperNode node) { 18 | subclasses.add(node); 19 | } 20 | 21 | public StructClass getClassStruct() { 22 | return classStruct; 23 | } 24 | 25 | public List getSubclasses() { 26 | return subclasses; 27 | } 28 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/modules/renamer/PoolInterceptor.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.modules.renamer; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | public class PoolInterceptor { 8 | private final Map mapOldToNewNames = new HashMap<>(); 9 | private final Map mapNewToOldNames = new HashMap<>(); 10 | 11 | public void addName(String oldName, String newName) { 12 | mapOldToNewNames.put(oldName, newName); 13 | mapNewToOldNames.put(newName, oldName); 14 | } 15 | 16 | public String getName(String oldName) { 17 | return mapOldToNewNames.get(oldName); 18 | } 19 | 20 | public String getOldName(String newName) { 21 | return mapNewToOldNames.get(newName); 22 | } 23 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/IDecompiledData.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct; 3 | 4 | public interface IDecompiledData { 5 | 6 | String getClassEntryName(StructClass cl, String entryname); 7 | 8 | String getClassContent(StructClass cl); 9 | } 10 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/attr/StructAnnDefaultAttribute.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.attr; 3 | 4 | import qunar.tc.decompiler.modules.decompiler.exps.Exprent; 5 | import qunar.tc.decompiler.struct.consts.ConstantPool; 6 | import qunar.tc.decompiler.util.DataInputFullStream; 7 | 8 | import java.io.IOException; 9 | 10 | public class StructAnnDefaultAttribute extends StructGeneralAttribute { 11 | 12 | private Exprent defaultValue; 13 | 14 | @Override 15 | public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { 16 | defaultValue = StructAnnotationAttribute.parseAnnotationElement(data, pool); 17 | } 18 | 19 | public Exprent getDefaultValue() { 20 | return defaultValue; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/attr/StructConstantValueAttribute.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.attr; 3 | 4 | import qunar.tc.decompiler.struct.consts.ConstantPool; 5 | import qunar.tc.decompiler.util.DataInputFullStream; 6 | 7 | import java.io.IOException; 8 | 9 | public class StructConstantValueAttribute extends StructGeneralAttribute { 10 | 11 | private int index; 12 | 13 | @Override 14 | public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { 15 | index = data.readUnsignedShort(); 16 | } 17 | 18 | public int getIndex() { 19 | return index; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/attr/StructGenericSignatureAttribute.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.attr; 3 | 4 | import qunar.tc.decompiler.struct.consts.ConstantPool; 5 | import qunar.tc.decompiler.util.DataInputFullStream; 6 | 7 | import java.io.IOException; 8 | 9 | public class StructGenericSignatureAttribute extends StructGeneralAttribute { 10 | 11 | private String signature; 12 | 13 | @Override 14 | public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException { 15 | int index = data.readUnsignedShort(); 16 | signature = pool.getPrimitiveConstant(index).getString(); 17 | } 18 | 19 | public String getSignature() { 20 | return signature; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/consts/PooledConstant.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.consts; 3 | 4 | import qunar.tc.decompiler.code.CodeConstants; 5 | 6 | public class PooledConstant implements CodeConstants { 7 | public final int type; 8 | 9 | public PooledConstant(int type) { 10 | this.type = type; 11 | } 12 | 13 | public void resolveConstant(ConstantPool pool) { 14 | } 15 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/gen/NewClassNameBuilder.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.gen; 3 | 4 | public interface NewClassNameBuilder { 5 | String buildNewClassname(String className); 6 | } 7 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/gen/generics/GenericClassDescriptor.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.gen.generics; 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | public class GenericClassDescriptor { 8 | 9 | public GenericType superclass; 10 | 11 | public final List superinterfaces = new ArrayList<>(); 12 | 13 | public final List fparameters = new ArrayList<>(); 14 | 15 | public final List> fbounds = new ArrayList<>(); 16 | } 17 | -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/gen/generics/GenericFieldDescriptor.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.gen.generics; 3 | 4 | public class GenericFieldDescriptor { 5 | public final GenericType type; 6 | 7 | public GenericFieldDescriptor(GenericType type) { 8 | this.type = type; 9 | } 10 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/struct/match/IMatchable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.struct.match; 3 | 4 | public interface IMatchable { 5 | enum MatchProperties { 6 | STATEMENT_TYPE, 7 | STATEMENT_RET, 8 | STATEMENT_STATSIZE, 9 | STATEMENT_EXPRSIZE, 10 | STATEMENT_POSITION, 11 | STATEMENT_IFTYPE, 12 | 13 | EXPRENT_TYPE, 14 | EXPRENT_RET, 15 | EXPRENT_POSITION, 16 | EXPRENT_FUNCTYPE, 17 | EXPRENT_EXITTYPE, 18 | EXPRENT_CONSTTYPE, 19 | EXPRENT_CONSTVALUE, 20 | EXPRENT_INVOCATION_CLASS, 21 | EXPRENT_INVOCATION_SIGNATURE, 22 | EXPRENT_INVOCATION_PARAMETER, 23 | EXPRENT_VAR_INDEX, 24 | EXPRENT_FIELD_NAME, 25 | } 26 | 27 | IMatchable findObject(MatchNode matchNode, int index); 28 | 29 | boolean match(MatchNode matchNode, MatchEngine engine); 30 | } -------------------------------------------------------------------------------- /bistoury-decompiler-fernflower/src/main/java/qunar/tc/decompiler/util/DataInputFullStream.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. 2 | package qunar.tc.decompiler.util; 3 | 4 | import java.io.ByteArrayInputStream; 5 | import java.io.DataInputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | public class DataInputFullStream extends DataInputStream { 10 | public DataInputFullStream(byte[] bytes) { 11 | super(new ByteArrayInputStream(bytes)); 12 | } 13 | 14 | public DataInputFullStream(InputStream in) { 15 | super(in); 16 | } 17 | 18 | public byte[] read(int n) throws IOException { 19 | return InterpreterUtil.readBytes(this, n); 20 | } 21 | 22 | public void discard(int n) throws IOException { 23 | InterpreterUtil.discardBytes(this, n); 24 | } 25 | } -------------------------------------------------------------------------------- /bistoury-dist/assembly/assembly-agent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bin 5 | 6 | bistoury-agent-bin 7 | 8 | 9 | dir 10 | tar.gz 11 | 12 | false 13 | 14 | 15 | 16 | bin/** 17 | 18 | 0755 19 | keep 20 | 21 | 22 | 23 | 24 | 25 | lib 26 | false 27 | false 28 | 29 | 30 | -------------------------------------------------------------------------------- /bistoury-dist/bin/async-profiler/async-profiler-1.6-linux-x64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-dist/bin/async-profiler/async-profiler-1.6-linux-x64.so -------------------------------------------------------------------------------- /bistoury-dist/bin/async-profiler/async-profiler-1.6-macos-x64.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-dist/bin/async-profiler/async-profiler-1.6-macos-x64.so -------------------------------------------------------------------------------- /bistoury-dist/bin/base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | TIMESTAMP=$(date +%s) 5 | BISTOURY_COF_DIR="$BISTOURY_BIN_DIR/../conf" 6 | BISTOURY_PID_DIR="$BISTOURY_BIN_DIR/../pid" 7 | BISTOURY_LOG_DIR="$BISTOURY_BIN_DIR/../logs" 8 | BISTOURY_LIB_DIR="$BISTOURY_BIN_DIR/../lib" 9 | BISTOURY_STORE_DIR="$BISTOURY_BIN_DIR/../store" 10 | 11 | if [[ ! -w "$BISTOURY_PID_DIR" ]] ; then 12 | mkdir -p "$BISTOURY_PID_DIR" 13 | fi 14 | 15 | if [[ ! -w "$BISTOURY_LOG_DIR" ]] ; then 16 | mkdir -p "$BISTOURY_LOG_DIR" 17 | fi 18 | 19 | if [[ ! -w "$BISTOURY_STORE_DIR" ]] ; then 20 | mkdir -p "$BISTOURY_STORE_DIR" 21 | fi 22 | 23 | CLASSPATH="$BISTOURY_COF_DIR" 24 | for i in "$BISTOURY_BIN_DIR"/../lib/* 25 | do 26 | CLASSPATH="$i:$CLASSPATH" 27 | done -------------------------------------------------------------------------------- /bistoury-dist/bin/bistoury-agent-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | BISTOURY_STORY_PATH="$BISTOURY_STORE_DIR" 5 | BISTOURY_PROXY_HOST="127.0.0.1:9090" 6 | BISTOURY_APP_LIB_CLASS="org.springframework.web.servlet.DispatcherServlet" 7 | JAVA_HOME="/tmp/bistoury/java" 8 | JAVA_OPTS="-Dbistoury.store.path=$BISTOURY_STORY_PATH -Dbistoury.proxy.host=$BISTOURY_PROXY_HOST" 9 | -------------------------------------------------------------------------------- /bistoury-dist/bin/inputrc: -------------------------------------------------------------------------------- 1 | "\e[D": backward-char 2 | "\e[C": forward-char 3 | "\e[B": next-history 4 | "\e[A": previous-history 5 | "\C-?": backward-delete-char 6 | "\C-h": backward-delete-char 7 | "\C-X\C-U": undo 8 | "\eb": backward-word 9 | "\C-e": end-of-line 10 | "\C-a": beginning-of-line 11 | "\C-D": delete-char 12 | "\e[3~": delete-char 13 | "\C-i": complete 14 | "\C-j": accept-line 15 | "\C-m": accept-line 16 | "\C-k": kill-line 17 | "\eb": backward-word 18 | "\ef": forward-word 19 | "\e\C-?": backward-kill-word 20 | "\C-x[3~": backward-kill-line 21 | -------------------------------------------------------------------------------- /bistoury-dist/bin/qjmap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "\033[31m[WARING]:\033[0m Bistoury 不再支持 \033[34mqjmap\033[0m 命令,请使用 \033[34mheapdump\033[0m 命令 dump 内存信息,使用 \033[34mheapdump -h\033[0m 查看命令帮助" -------------------------------------------------------------------------------- /bistoury-dist/bin/qjmxcli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "\033[31m[WARING]:\033[0m Bistoury 不再支持 \033[34mqjmxcli\033[0m 命令,请使用 mbean 命令查看 \033[34mMBean\033[0m 信息,使用 \033[34mjstat\033[0m 命令查看 GC 信息" -------------------------------------------------------------------------------- /bistoury-dist/bin/qjtool-base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . "$BISTOURY_BIN_DIR/base.sh" 4 | . "$BISTOURY_BIN_DIR/bistoury-agent-env.sh" 5 | 6 | 7 | if [[ "$JAVA_HOME" != "" ]];then 8 | JAVA_HOME="$JAVA_HOME" 9 | else 10 | echo "Please set JAVA_HOME env before run this script" 11 | exit 1 12 | fi 13 | 14 | -------------------------------------------------------------------------------- /bistoury-dist/bin/qjtop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "\033[31m[WARING]:\033[0m Bistoury 不再支持 \033[34mqjtop\033[0m 命令,可到主机信息页面查看 JVM 指标及繁忙线程" -------------------------------------------------------------------------------- /bistoury-independent-agent/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [%d{HH:mm:ss} [%thread] %-5level%logger{36}:%L] - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/classpath/AppClassPathSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.classpath; 19 | 20 | import com.google.common.base.Supplier; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * @author zhenyu.nie created on 2019 2019/7/18 13:34 26 | */ 27 | public interface AppClassPathSupplier extends Supplier> { 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/classpath/AppClassPathSupplierFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.classpath; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/7/18 17:30 22 | */ 23 | public interface AppClassPathSupplierFactory { 24 | 25 | AppClassPathSupplier create(String appLibPath); 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/classpath/AppLibClassSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.classpath; 19 | 20 | 21 | import com.google.common.base.Supplier; 22 | 23 | /** 24 | * @author zhenyu.nie created on 2019 2019/3/4 16:21 25 | */ 26 | public interface AppLibClassSupplier extends Supplier> { 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/metrics/Counter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.metrics; 19 | 20 | public interface Counter { 21 | 22 | void inc(); 23 | 24 | void inc(long n); 25 | 26 | void dec(); 27 | 28 | void dec(long n); 29 | 30 | long getCount(); 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/metrics/Delta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.metrics; 19 | 20 | interface Delta { 21 | 22 | void tick(); 23 | } 24 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/metrics/Item.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.metrics; 19 | 20 | import qunar.tc.bistoury.clientside.common.monitor.MetricType; 21 | 22 | public class Item { 23 | 24 | public String name; 25 | 26 | public MetricType type; 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/metrics/KeyWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.metrics; 19 | 20 | public abstract class KeyWrapper extends MetricKey { 21 | 22 | public KeyWrapper(String name) { 23 | super(name); 24 | } 25 | 26 | public abstract T get(); 27 | } -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/metrics/MetricsReportor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.metrics; 19 | 20 | import qunar.tc.bistoury.clientside.common.monitor.MetricsSnapshot; 21 | 22 | /** 23 | * 监控指标汇报器。 24 | * 25 | * @author Daniel Li 26 | * @since 16 September 2015 27 | */ 28 | public interface MetricsReportor { 29 | 30 | MetricsSnapshot report(String name); 31 | } -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/monitor/AgentGenerated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.monitor; 19 | 20 | import java.lang.annotation.*; 21 | 22 | /** 23 | * Created by zhaohui.yu 24 | * 5/25/15 25 | */ 26 | @Target({ElementType.METHOD}) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Inherited 29 | @Documented 30 | public @interface AgentGenerated { 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/monitor/Matcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.instrument.client.monitor; 19 | 20 | import java.security.ProtectionDomain; 21 | 22 | /** 23 | * Created by zhaohui.yu 24 | * 15/10/19 25 | */ 26 | public interface Matcher { 27 | boolean match(ProtectionDomain domain); 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/Mode.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | /** 4 | * @author cai.wen created on 2019/10/23 10:45 5 | */ 6 | public enum Mode { 7 | sampler(1), async_sampler(0); 8 | 9 | private final int code; 10 | 11 | Mode(int code) { 12 | this.code = code; 13 | } 14 | 15 | public static Mode codeOf(int code) { 16 | for (Mode mode : values()) { 17 | if (mode.code == code) { 18 | return mode; 19 | } 20 | } 21 | throw new IllegalArgumentException("Invalid mode code: " + code); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/Profiler.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | /** 4 | * @author cai.wen created on 2019/10/23 10:18 5 | */ 6 | public interface Profiler { 7 | 8 | String getId(); 9 | 10 | String getStatus(); 11 | 12 | void start(); 13 | 14 | void stop(); 15 | } 16 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/ProfilerConstants.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | /** 4 | * @author cai.wen created on 2019/10/23 11:38 5 | */ 6 | public class ProfilerConstants { 7 | 8 | public static final String INTERVAL = "interval"; 9 | 10 | public static final String DURATION = "duration"; 11 | 12 | public static final String EVENT = "event"; 13 | 14 | public static final String MODE = "mode"; 15 | 16 | public static final String THREADS = "threads"; 17 | 18 | public static final String PROFILER_ID = "profilerId"; 19 | 20 | public static final String STORE_DIR = "storeDir"; 21 | } 22 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/ProfilerContext.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/12/30 18:58 5 | */ 6 | public interface ProfilerContext { 7 | 8 | String getId(); 9 | 10 | long getStartTime(); 11 | 12 | long getIntervalMs(); 13 | 14 | String getStatus(); 15 | 16 | void start(); 17 | 18 | void stop(); 19 | 20 | void tryStop(); 21 | } 22 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/ProfilerInfo.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | import java.util.concurrent.ScheduledExecutorService; 4 | import java.util.concurrent.locks.Lock; 5 | 6 | /** 7 | * @author zhenyu.nie created on 2019 2019/12/31 17:17 8 | */ 9 | public class ProfilerInfo { 10 | 11 | private final Lock lock; 12 | 13 | private final ScheduledExecutorService executor; 14 | 15 | private ProfilerContext profilerContext; 16 | 17 | public ProfilerInfo(Lock lock, ScheduledExecutorService executor) { 18 | this.lock = lock; 19 | this.executor = executor; 20 | } 21 | 22 | public Lock getLock() { 23 | return lock; 24 | } 25 | 26 | public ScheduledExecutorService getExecutor() { 27 | return executor; 28 | } 29 | 30 | public ProfilerContext getProfilerContext() { 31 | return profilerContext; 32 | } 33 | 34 | public void setProfilerContext(ProfilerContext profilerContext) { 35 | this.profilerContext = profilerContext; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/ProfilerStore.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * @author zhenyu.nie created on 2019 2019/12/31 14:54 7 | */ 8 | public interface ProfilerStore { 9 | 10 | boolean isRunning(); 11 | 12 | ProfilerContext start(Map config); 13 | 14 | String getStatus(); 15 | 16 | String getStatus(String id); 17 | 18 | void clear(); 19 | } 20 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/Profilers.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler; 2 | 3 | import com.google.common.base.Optional; 4 | import qunar.tc.bistoury.clientside.common.store.BistouryStore; 5 | import qunar.tc.bistoury.common.ProfilerUtil; 6 | 7 | import java.io.File; 8 | 9 | /** 10 | * @author zhenyu.nie created on 2019 2019/11/27 10:32 11 | */ 12 | public class Profilers { 13 | 14 | public static String findNotRunningStatus(String id) { 15 | Optional profilerDirRef = ProfilerUtil.getProfilerDir(BistouryStore.DEFAULT_PROFILER_ROOT_PATH, id); 16 | if (profilerDirRef.isPresent()) { 17 | return ProfilerUtil.FINISH_STATUS; 18 | } else { 19 | return ProfilerUtil.ERROR_STATUS; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/sync/runtime/cpu/ThreadCpuInfo.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler.sync.runtime.cpu; 2 | 3 | import java.lang.management.ThreadInfo; 4 | 5 | /** 6 | * @author cai.wen created on 2019/10/18 19:18 7 | */ 8 | public class ThreadCpuInfo { 9 | 10 | private final ThreadInfo threadInfo; 11 | 12 | private final long cpuTime; 13 | 14 | public ThreadCpuInfo(ThreadInfo threadInfo, long cpuTime) { 15 | this.threadInfo = threadInfo; 16 | this.cpuTime = cpuTime; 17 | } 18 | 19 | public ThreadInfo getThreadInfo() { 20 | return threadInfo; 21 | } 22 | 23 | public long getCpuTime() { 24 | return cpuTime; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/profiler/sync/task/Task.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.profiler.sync.task; 2 | 3 | /** 4 | * @author cai.wen created on 2019/10/23 20:30 5 | */ 6 | public interface Task { 7 | 8 | void init(); 9 | 10 | void stop(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/spring/el/BooleanLiteral.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.spring.el; 2 | 3 | 4 | import org.objectweb.asm.MethodVisitor; 5 | 6 | /** 7 | * Represents the literal values {@code TRUE} and {@code FALSE}. 8 | * 9 | * @author Andy Clement 10 | * @since 3.0 11 | */ 12 | class BooleanLiteral extends Literal { 13 | 14 | private final BooleanTypedValue value; 15 | 16 | 17 | public BooleanLiteral(String payload, int pos, boolean value) { 18 | super(payload, pos); 19 | this.value = BooleanTypedValue.forValue(value); 20 | this.exitTypeDescriptor = "Z"; 21 | } 22 | 23 | 24 | @Override 25 | public BooleanTypedValue getLiteralValue() { 26 | return this.value; 27 | } 28 | 29 | @Override 30 | public boolean isCompilable() { 31 | return true; 32 | } 33 | 34 | @Override 35 | public void generateCode(MethodVisitor mv, CodeFlow cf) { 36 | if (this.value == BooleanTypedValue.TRUE) { 37 | mv.visitLdcInsn(1); 38 | } 39 | else { 40 | mv.visitLdcInsn(0); 41 | } 42 | cf.pushDescriptor(this.exitTypeDescriptor); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/spring/el/FloatLiteral.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.instrument.client.spring.el; 2 | 3 | 4 | import org.objectweb.asm.MethodVisitor; 5 | 6 | /** 7 | * Expression language AST node that represents a float literal. 8 | * 9 | * @author Satyapal Reddy 10 | * @author Andy Clement 11 | * @since 3.2 12 | */ 13 | class FloatLiteral extends Literal { 14 | 15 | private final TypedValue value; 16 | 17 | 18 | public FloatLiteral(String payload, int pos, float value) { 19 | super(payload, pos); 20 | this.value = new TypedValue(value); 21 | this.exitTypeDescriptor = "F"; 22 | } 23 | 24 | 25 | @Override 26 | public TypedValue getLiteralValue() { 27 | return this.value; 28 | } 29 | 30 | @Override 31 | public boolean isCompilable() { 32 | return true; 33 | } 34 | 35 | @Override 36 | public void generateCode(MethodVisitor mv, CodeFlow cf) { 37 | mv.visitLdcInsn(this.value.getValue()); 38 | cf.pushDescriptor(this.exitTypeDescriptor); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/main/java/qunar/tc/bistoury/instrument/client/spring/el/ObjectToStringConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2009 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package qunar.tc.bistoury.instrument.client.spring.el; 18 | 19 | 20 | /** 21 | * Simply calls {@link Object#toString()} to convert a source Object to a String. 22 | * @author Keith Donald 23 | * @since 3.0 24 | */ 25 | final class ObjectToStringConverter implements Converter { 26 | 27 | public String convert(Object source) { 28 | return source.toString(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/test/java/qunar/tc/test/ExceptionTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.test; 2 | 3 | import java.io.FileNotFoundException; 4 | 5 | /** 6 | * @author leix.xie 7 | * @date 2019/10/10 15:32 8 | * @describe 9 | */ 10 | public class ExceptionTest { 11 | public static void main(String[] args) throws FileNotFoundException { 12 | test(); 13 | } 14 | 15 | public static int test() throws FileNotFoundException { 16 | try { 17 | if (true) { 18 | throw new FileNotFoundException(); 19 | } 20 | return 1; 21 | } catch (Throwable e) { 22 | System.out.println(e.getClass().getName()); 23 | System.out.println(e instanceof IllegalStateException); 24 | throw e; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-instrument-client/src/test/java/qunar/tc/test/MethodVistorTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.test; 2 | 3 | import org.objectweb.asm.MethodVisitor; 4 | import org.objectweb.asm.commons.AdviceAdapter; 5 | 6 | /** 7 | * @author: leix.xie 8 | * @date: 2018/12/29 17:06 9 | * @describe: 10 | */ 11 | public class MethodVistorTest extends AdviceAdapter { 12 | 13 | 14 | /** 15 | * Creates a new {@link AdviceAdapter}. 16 | * 17 | * @param api the ASM API version implemented by this visitor. Must be one 18 | * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}. 19 | * @param mv the method visitor to which this adapter delegates calls. 20 | * @param access the method's access flags (see {@link Opcodes}). 21 | * @param name the method's name. 22 | * @param desc the method's descriptor (see {@link Type Type}). 23 | */ 24 | protected MethodVistorTest(int api, MethodVisitor mv, int access, String name, String desc) { 25 | super(api, mv, access, name, desc); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-instrument-spy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | bistoury 7 | qunar.tc.bistoury 8 | 2.0.7 9 | 10 | 4.0.0 11 | 12 | bistoury-instrument-spy 13 | jar 14 | 15 | 16 | false 17 | 18 | 19 | -------------------------------------------------------------------------------- /bistoury-instrument-spy/src/main/java/one/profiler/Counter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Andrei Pangin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package one.profiler; 18 | 19 | /** 20 | * Which metrics to use when generating profile in collapsed stack traces format. 21 | */ 22 | public enum Counter { 23 | SAMPLES, 24 | TOTAL 25 | } 26 | -------------------------------------------------------------------------------- /bistoury-instrument-spy/src/main/java/one/profiler/Events.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Andrei Pangin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package one.profiler; 18 | 19 | /** 20 | * Predefined event names to use in {@link AsyncProfiler#start(String, long)} 21 | */ 22 | public class Events { 23 | public static final String CPU = "cpu"; 24 | public static final String ALLOC = "alloc"; 25 | public static final String LOCK = "lock"; 26 | public static final String WALL = "wall"; 27 | public static final String ITIMER = "itimer"; 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-instrument-spy/src/main/java/one/profiler/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * from https://github.com/jvm-profiling-tools/async-profiler 4 | */ 5 | package one.profiler; 6 | -------------------------------------------------------------------------------- /bistoury-magic-classes/src/main/java/qunar/tc/bistoury/magic/classes/MagicUtils.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.magic.classes; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2018 2018/11/30 14:19 5 | */ 6 | public class MagicUtils { 7 | 8 | private static final ThreadLocal magicFlagThreadLocal = new ThreadLocal<>(); 9 | 10 | public static void setMagicFlag() { 11 | magicFlagThreadLocal.set(true); 12 | } 13 | 14 | public static void removeMagicFlag() { 15 | magicFlagThreadLocal.remove(); 16 | } 17 | 18 | public static boolean needMagic() { 19 | Boolean needMagic = magicFlagThreadLocal.get(); 20 | return needMagic != null && needMagic; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bistoury-magic-loader/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | bistoury 7 | qunar.tc.bistoury 8 | 2.0.7 9 | 10 | 4.0.0 11 | 12 | bistoury-magic-loader 13 | jar 14 | 15 | 16 | false 17 | 18 | 19 | 20 | 21 | ${project.groupId} 22 | bistoury-magic-classes 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /bistoury-metrics-prometheus/src/main/resources/META-INF/services/qunar.tc.bistoury.serverside.metrics.BistouryMetricRegistry: -------------------------------------------------------------------------------- 1 | qunar.tc.bistoury.metrics.prometheus.PrometheusBistouryMetricRegistry -------------------------------------------------------------------------------- /bistoury-proxy/conf/agent_config_override.properties: -------------------------------------------------------------------------------- 1 | #动态更新 2 | #覆盖agent从proxy拉取的配置的值,小于指定版本的配置全部重写为指定值, 3 | #配置key=版本,重写值 4 | #将agent版本低于9的所有agent的所有cpuJStackOn值设置为false 5 | #cpuJStackOn=9,false -------------------------------------------------------------------------------- /bistoury-proxy/conf/download_dir_limit.properties: -------------------------------------------------------------------------------- 1 | #文件下载文件夹限制,只能在指定目录下下载,可以对每个appcode进行单独限制 2 | 3 | #文件下载文件夹限制, 全局默认值, 多个文件夹使用英文逗号(,)分隔,dump文件夹。/tmp/bistoury-class-dump位于com/taobao/arthas/core/advisor/Enhancer.java:209中修改 4 | default.download.dump.dir=/tmp/bistoury/qjtools/qjdump,/tmp/bistoury-class-dump 5 | #文件下载文件夹限制,全局默认值, 多个文件夹使用英文逗号(,)分隔,其他文件夹 6 | default.download.other.dir=/Users/leix.xie/Downloads/ 7 | 8 | #针对appcode进行限制 9 | #文件下载文件夹限制, 针对appcode限制, 多个文件夹使用英文逗号(,)分隔,dump文件夹 10 | #appcode.download.dump.dir=/tmp/bistoury/qjtools/qjdump 11 | #文件下载文件夹限制,针对appcode限制, 多个文件夹使用英文逗号(,)分隔,其他文件夹 12 | #appcode.download.other.dir=/Users/leix.xie/Downloads/ -------------------------------------------------------------------------------- /bistoury-proxy/conf/global.properties: -------------------------------------------------------------------------------- 1 | #必填,proxy 提供给ui的netty端口 2 | server.port=9881 3 | #必填,proxy netty 端口 4 | agent.newport=9880 5 | #必填,动态更新,jstack命令的在agent机器上的本地路径 6 | jstack.location=jstack 7 | #必填,动态更新,jstat命令的在agent机器上的本地路径 8 | jstat.location=jstat -------------------------------------------------------------------------------- /bistoury-proxy/conf/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://127.0.0.1:3306/bistoury?characterEncoding=utf8&rewriteBatchedStatements=true&allowMultiQueries=true&cachePrepStmts=true&cacheResultSetMetadata=true&cacheServerConfiguration=true&useServerPrepStmts=true 3 | jdbc.username=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /bistoury-proxy/conf/profiler.properties: -------------------------------------------------------------------------------- 1 | #默认的抽样时长 2 | default.duration=120 3 | #默认的抽样间隔 4 | default.interval=1 5 | #是否区分线程 6 | default.threads=false 7 | #(0为异步抽样,1为同步抽样) 8 | #异步抽样对性能的影响最小,同步抽样需要增大抽样间隔(大于10)= 9 | default.mode=0 10 | #可以根据应用修改对应的参数,例如将 demo_app 的间隔修改为10 11 | #demo_app.frequency=10 12 | #抽样的事件 13 | default.event=itimer -------------------------------------------------------------------------------- /bistoury-proxy/conf/prometheus.properties: -------------------------------------------------------------------------------- 1 | #监控类型,默认使用prometheus实现 2 | monitor.type=prometheus 3 | #监控数据抓取路径,默认ip:port/metrics 4 | monitor.action=metrics 5 | #监控数据抓取端口,默认3333 6 | monitor.port=3333 7 | #另外也提供了Graphite方式的接入,只需要在里按照如下配置即可: 8 | #monitor.type=graphite 9 | #graphite.host= 10 | #graphite.port= -------------------------------------------------------------------------------- /bistoury-proxy/conf/registry.properties: -------------------------------------------------------------------------------- 1 | #必填,proxy机器注册的zk地址 2 | default=127.0.0.1:2181 3 | -------------------------------------------------------------------------------- /bistoury-proxy/conf/releaseInfo_config.properties: -------------------------------------------------------------------------------- 1 | #动态更新 2 | #发布信息,应用的发布信息文件的路径,默认值为相对日志目录的相对路径../webapps/releaseInfo.properties,可以通过default修改默认值 3 | #可以是绝对路径 4 | #可选,配置默认路径,默认值为 ../webapps/releaseInfo.properties 5 | default=/tmp/bistoury/releaseInfo.properties 6 | #也可以是相对日志目录的相对路径 7 | #default=../webapps/releaseInfo.properties 8 | #针对appcode进行设置,即每个appcode的发布信息文件路径需要保持一致,如: 9 | #bistoury_ui=../webapps/releaseInfo.properties -------------------------------------------------------------------------------- /bistoury-proxy/conf/server.properties: -------------------------------------------------------------------------------- 1 | tomcat.port=9090 2 | tomcat.basedir=/tmp/bistoury/tomcat/proxy 3 | 4 | -------------------------------------------------------------------------------- /bistoury-proxy/src/bin/base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | TIMESTAMP=$(date +%s) 5 | BISTOURY_COF_DIR="$BISTOURY_BIN_DIR/../conf" 6 | BISTOURY_PID_DIR="$BISTOURY_BIN_DIR/../pid" 7 | BISTOURY_LOG_DIR="$BISTOURY_BIN_DIR/../logs" 8 | 9 | if [[ ! -w "$BISTOURY_PID_DIR" ]] ; then 10 | mkdir -p "$BISTOURY_PID_DIR" 11 | fi 12 | 13 | if [[ ! -w "$BISTOURY_LOG_DIR" ]] ; then 14 | mkdir -p "$BISTOURY_LOG_DIR" 15 | fi 16 | 17 | CLASSPATH="$BISTOURY_COF_DIR" 18 | for i in "$BISTOURY_BIN_DIR"/../lib/* 19 | do 20 | CLASSPATH="$i:$CLASSPATH" 21 | done -------------------------------------------------------------------------------- /bistoury-proxy/src/bin/bistoury-proxy-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | JAVA_HOME="/tmp/bistoury/java" 5 | JAVA_OPTS="-Dbistoury.conf=$BISTOURY_COF_DIR" 6 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/communicate/NettyServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.proxy.communicate; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/7/19 17:00 22 | */ 23 | public interface NettyServer { 24 | 25 | void start(); 26 | 27 | boolean isActive(); 28 | 29 | void stop(); 30 | } 31 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/communicate/WritableListener.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.communicate; 2 | 3 | /** 4 | * @author zhenyu.nie created on 2019 2019/10/31 15:30 5 | */ 6 | public interface WritableListener { 7 | 8 | void onChange(boolean writable); 9 | } 10 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/communicate/WriteResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.proxy.communicate; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/5/15 12:19 22 | */ 23 | public enum WriteResult { 24 | 25 | success, fail 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/communicate/agent/AgentConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.proxy.communicate.agent; 19 | 20 | import qunar.tc.bistoury.proxy.communicate.Connection; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2019 2019/5/13 14:18 24 | */ 25 | public interface AgentConnection extends Connection { 26 | 27 | String getAgentId(); 28 | 29 | int getVersion(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/communicate/agent/handler/AgentMessageProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.proxy.communicate.agent.handler; 19 | 20 | import qunar.tc.bistoury.proxy.communicate.MessageProcessor; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2019 2019/5/17 11:36 24 | */ 25 | public interface AgentMessageProcessor extends MessageProcessor { 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/dao/ProfilerDao.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.dao; 2 | 3 | import qunar.tc.bistoury.serverside.bean.Profiler; 4 | 5 | import java.util.Optional; 6 | 7 | /** 8 | * @author cai.wen created on 2019/10/30 14:52 9 | */ 10 | public interface ProfilerDao { 11 | 12 | void changeState(Profiler.State state, String profilerId); 13 | 14 | void prepareProfiler(Profiler profiler); 15 | 16 | Optional getLastRecord(String app, String agentId); 17 | 18 | Profiler getRecordByProfilerId(String profilerId); 19 | } 20 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/dao/ProfilerLockDao.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.dao; 2 | 3 | public interface ProfilerLockDao { 4 | 5 | void insert(String appCode, String agentId); 6 | 7 | void delete(String appCode, String agentId); 8 | } 9 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/dao/ProfilerLockDaoImpl.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.dao; 2 | 3 | import org.springframework.jdbc.core.JdbcTemplate; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import javax.annotation.Resource; 7 | 8 | @Repository 9 | public class ProfilerLockDaoImpl implements ProfilerLockDao { 10 | 11 | private static final String LOCK_PROFILER_SQL = "insert into bistoury_profiler_lock (app_code, agent_id) VALUES (?,?)"; 12 | 13 | private static final String UNLOCK_PROFILER_SQL = "delete from bistoury_profiler_lock where app_code=? and agent_id=?"; 14 | 15 | @Resource 16 | private JdbcTemplate jdbcTemplate; 17 | 18 | @Override 19 | public void insert(String appCode, String agentId) { 20 | jdbcTemplate.update(LOCK_PROFILER_SQL, appCode, agentId); 21 | } 22 | 23 | @Override 24 | public void delete(String appCode, String agentId) { 25 | jdbcTemplate.update(UNLOCK_PROFILER_SQL, appCode, agentId); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/generator/IdGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.proxy.generator; 19 | 20 | /** 21 | * @author leix.xie 22 | * @date 2019/5/17 10:36 23 | * @describe 24 | */ 25 | public interface IdGenerator { 26 | String generateId(); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/service/profiler/ProfilerDataManager.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.service.profiler; 2 | 3 | /** 4 | * @author cai.wen created on 2019/10/30 10:22 5 | */ 6 | public interface ProfilerDataManager { 7 | 8 | void requestData(String profilerId, String agentId); 9 | } 10 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/service/profiler/ProfilerManager.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.service.profiler; 2 | 3 | import qunar.tc.bistoury.serverside.bean.ProfilerSettings; 4 | 5 | /** 6 | * @author cai.wen created on 2019/10/30 16:54 7 | */ 8 | public interface ProfilerManager { 9 | 10 | String prepare(String agentId, ProfilerSettings settings); 11 | 12 | void start(String profilerId); 13 | 14 | void stop(String profilerId); 15 | 16 | void stopWithError(String profilerId); 17 | } 18 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/service/profiler/ProfilerService.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.service.profiler; 2 | 3 | import qunar.tc.bistoury.serverside.bean.Profiler; 4 | import qunar.tc.bistoury.serverside.bean.ProfilerSettings; 5 | 6 | /** 7 | * @author cai.wen created on 2019/10/30 14:50 8 | */ 9 | public interface ProfilerService { 10 | 11 | void startProfiler(String profilerId); 12 | 13 | String prepareProfiler(String agentId, ProfilerSettings profilerSettings); 14 | 15 | Profiler getProfilerRecord(String profilerId); 16 | 17 | void stopProfiler(String profilesId); 18 | 19 | void stopWithError(String profilerId); 20 | } 21 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/service/profiler/ProfilerSettingsManager.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.service.profiler; 2 | 3 | import qunar.tc.bistoury.serverside.bean.ProfilerSettings; 4 | 5 | import java.util.Map; 6 | 7 | public interface ProfilerSettingsManager { 8 | 9 | ProfilerSettings create(String appCode, Map config); 10 | } 11 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/service/profiler/ProfilerSettingsStore.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.service.profiler; 2 | 3 | public interface ProfilerSettingsStore { 4 | 5 | String getDurationSeconds(String appCode); 6 | 7 | String getIntervalMillis(String appCode); 8 | 9 | boolean isThreads(String appCode); 10 | 11 | String getEvent(String appCode); 12 | 13 | String getModeCode(String appCode); 14 | } 15 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/util/ServerFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.proxy.util; 19 | 20 | import java.util.List; 21 | 22 | import qunar.tc.bistoury.application.api.pojo.AppServer; 23 | 24 | public interface ServerFinder { 25 | 26 | List findAgents(String app); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/java/qunar/tc/bistoury/proxy/util/profiler/CallStackCounter.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.util.profiler; 2 | 3 | import qunar.tc.bistoury.common.profiler.method.FunctionInfo; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author cai.wen created on 19-11-24 9 | */ 10 | public class CallStackCounter { 11 | 12 | private final List functionInfos; 13 | 14 | private final long count; 15 | 16 | public CallStackCounter(List funcInfos, long count) { 17 | this.functionInfos = funcInfos; 18 | this.count = count; 19 | } 20 | 21 | public List getFunctionInfos() { 22 | return functionInfos; 23 | } 24 | 25 | public long getCount() { 26 | return count; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/resources/META-INF/services/qunar.tc.bistoury.serverside.jdbc.DataSourceFactory: -------------------------------------------------------------------------------- 1 | qunar.tc.bistoury.serverside.jdbc.DefaultDataSourceFactory -------------------------------------------------------------------------------- /bistoury-proxy/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | [%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5p %c:%L] %m%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/resources/spring/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/resources/spring/dispatcherServlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /bistoury-proxy/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-proxy/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /bistoury-proxy/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /bistoury-proxy/src/test/java/qunar/tc/bistoury/proxy/container/ProxyBootstrapForTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.proxy.container; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * @author xkrivzooh 9 | * @since 2019/8/15 10 | */ 11 | public class ProxyBootstrapForTest { 12 | 13 | @Test 14 | public void bootstrap() { 15 | String bistouryConfPath = ProxyBootstrapForTest.class.getResource("/conf").getPath().toString(); 16 | System.setProperty("bistoury.conf", bistouryConfPath); 17 | try { 18 | Bootstrap.main(new String[]{}); 19 | } 20 | catch (Exception e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/agent_config.properties: -------------------------------------------------------------------------------- 1 | #该文件的动态更新需要agent拉取过去之后才会生效 2 | #该文件中的配置会有agent从proxy拉取,除了这些配置外,还有jstack和jmap的开关状态#agent\u4ECEproxy\u83B7\u53D6\u914D\u7F6E\u7684\u65F6\u95F4\u95F4\u9694\uFF0C\u9ED8\u8BA410\u5206\u949F 3 | #可选,动态更新,agent从proxy获取配置的时间间隔,默认10分钟 4 | agent.refresh.interval.min=10 5 | #可选,动态更新,agent将配置推送到应用中的时间间隔,默认1分钟 6 | agent.push.interval.min=1 7 | #可选,动态更新,获取应用配置时排除掉的文件的后缀名,默认 class,vm,css,js,jar 8 | app.config.exclusion.file.suffix=class,vm,css,js,vue,ts,jsp,sql 9 | #可选,动态更新,获取应用配置时排除掉的文件 10 | app.config.exclusion.file.equal=web.xml 11 | #可选,动态更新,应用运行的tomcat的用户名,[ps aux | grep java] 结果的第1列,默认 tomcat 12 | tomcat.user=tomcat 13 | #可选,动态更新,应用运行Tomcat的Java命令,[ps aux | grep java] 结果的第11列,默认 /home/java/default/bin/java 14 | tomcat.command=/home/java/default/bin/java 15 | #可选,动态更新,debug结果序列化大小限制,太大可能会因为json序列化导致应用挂掉,默认 10240KB 16 | debug.json.limit.kb=10240 -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/agent_config_override.properties: -------------------------------------------------------------------------------- 1 | #动态更新 2 | #覆盖agent从proxy拉取的配置的值,小于指定版本的配置全部重写为指定值, 3 | #配置key=版本,重写值 4 | #将agent版本低于9的所有agent的所有cpuJStackOn值设置为false 5 | #cpuJStackOn=9,false -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/global.properties: -------------------------------------------------------------------------------- 1 | #必填,proxy 提供给ui的netty端口 2 | server.port=9881 3 | #必填,proxy netty 端口 4 | agent.newport=9880 5 | #必填,动态更新,jstack命令的在agent机器上的本地路径 6 | jstack.location=jstack 7 | #必填,动态更新,jstat命令的在agent机器上的本地路径 8 | jstat.location=jstat -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://127.0.0.1:3306/bistoury?characterEncoding=utf8&rewriteBatchedStatements=true&allowMultiQueries=true&cachePrepStmts=true&cacheResultSetMetadata=true&cacheServerConfiguration=true&useServerPrepStmts=true 3 | jdbc.username=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/profiler.properties: -------------------------------------------------------------------------------- 1 | #默认的抽样时长 2 | default.duration=120 3 | #默认的抽样间隔 4 | default.interval=1 5 | #是否区分线程 6 | default.threads=false 7 | #(0为异步抽样,1为同步抽样) 8 | #异步抽样对性能的影响最小,同步抽样需要增大抽样间隔(大于10)= 9 | default.mode=0 10 | #可以根据应用修改对应的参数,例如将 demo_app 的间隔修改为10 11 | #demo_app.frequency=10 12 | #抽样的事件 13 | default.event=itimer -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/prometheus.properties: -------------------------------------------------------------------------------- 1 | #监控类型,默认使用prometheus实现 2 | monitor.type=prometheus 3 | #监控数据抓取路径,默认ip:port/metrics 4 | monitor.action=metrics 5 | #监控数据抓取端口,默认3333 6 | monitor.port=3333 7 | #另外也提供了Graphite方式的接入,只需要在里按照如下配置即可: 8 | #monitor.type=graphite 9 | #graphite.host= 10 | #graphite.port= -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/registry.properties: -------------------------------------------------------------------------------- 1 | #必填,proxy机器注册的zk地址 2 | default=127.0.0.1:2181 3 | -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/releaseInfo_config.properties: -------------------------------------------------------------------------------- 1 | #动态更新 2 | #发布信息,应用的发布信息文件的路径,默认值为相对日志目录的相对路径../webapps/releaseInfo.properties,可以通过default修改默认值 3 | #可以是绝对路径 4 | #可选,配置默认路径,默认值为 ../webapps/releaseInfo.properties 5 | default=/tmp/releaseInfo.properties 6 | #也可以是相对日志目录的相对路径 7 | #default=../webapps/releaseInfo.properties 8 | #针对appcode进行设置,即每个appcode的发布信息文件路径需要保持一致,如: 9 | #bistoury_ui=../webapps/releaseInfo.properties -------------------------------------------------------------------------------- /bistoury-proxy/src/test/resources/conf/server.properties: -------------------------------------------------------------------------------- 1 | tomcat.port=9090 2 | tomcat.basedir=/tmp/tomcat 3 | 4 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/command/DownloadCommand.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.remoting.command; 2 | 3 | /** 4 | * @author leix.xie 5 | * @date 2019/11/5 15:22 6 | * @describe 7 | */ 8 | public class DownloadCommand { 9 | private String path; 10 | private String dir; 11 | 12 | public String getPath() { 13 | return path; 14 | } 15 | 16 | public void setPath(String path) { 17 | this.path = path; 18 | } 19 | 20 | public String getDir() { 21 | return dir; 22 | } 23 | 24 | public void setDir(String dir) { 25 | this.dir = dir; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "DownloadCommand{" + 31 | "path='" + path + '\'' + 32 | ", dir='" + dir + '\'' + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/netty/JobPauseProcessor.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.remoting.netty; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | import qunar.tc.bistoury.agent.common.ResponseHandler; 5 | import qunar.tc.bistoury.agent.common.job.ResponseJobStore; 6 | import qunar.tc.bistoury.remoting.protocol.CommandCode; 7 | import qunar.tc.bistoury.remoting.protocol.RemotingHeader; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author zhenyu.nie created on 2019 2019/10/31 14:49 13 | */ 14 | public class JobPauseProcessor implements Processor { 15 | 16 | private final ResponseJobStore jobStore; 17 | 18 | public JobPauseProcessor(ResponseJobStore jobStore) { 19 | this.jobStore = jobStore; 20 | } 21 | 22 | @Override 23 | public List types() { 24 | return ImmutableList.of(CommandCode.REQ_TYPE_JOB_PAUSE.getCode()); 25 | } 26 | 27 | @Override 28 | public void process(RemotingHeader header, String command, ResponseHandler handler) { 29 | jobStore.pause(command); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/netty/JobResumeProcessor.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.remoting.netty; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | import qunar.tc.bistoury.agent.common.ResponseHandler; 5 | import qunar.tc.bistoury.agent.common.job.ResponseJobStore; 6 | import qunar.tc.bistoury.remoting.protocol.CommandCode; 7 | import qunar.tc.bistoury.remoting.protocol.RemotingHeader; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author zhenyu.nie created on 2019 2019/10/31 14:53 13 | */ 14 | public class JobResumeProcessor implements Processor { 15 | 16 | private final ResponseJobStore jobStore; 17 | 18 | public JobResumeProcessor(ResponseJobStore jobStore) { 19 | this.jobStore = jobStore; 20 | } 21 | 22 | @Override 23 | public List types() { 24 | return ImmutableList.of(CommandCode.REQ_TYPE_JOB_RESUME.getCode()); 25 | } 26 | 27 | @Override 28 | public void process(RemotingHeader header, String command, ResponseHandler handler) { 29 | jobStore.resume(command); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/netty/RunnableTask.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.remoting.netty; 2 | 3 | import com.google.common.util.concurrent.ListenableFuture; 4 | 5 | /** 6 | * @author zhenyu.nie created on 2019 2019/10/30 15:49 7 | */ 8 | public interface RunnableTask { 9 | 10 | String getId(); 11 | 12 | long getMaxRunningMs(); 13 | 14 | ListenableFuture execute(); 15 | 16 | void pause(); 17 | 18 | void resume(); 19 | 20 | void cancel(); 21 | } 22 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/netty/RunnableTasks.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.remoting.netty; 2 | 3 | import qunar.tc.bistoury.agent.common.job.ResponseJobStore; 4 | 5 | /** 6 | * @author zhenyu.nie created on 2019 2019/10/30 15:50 7 | */ 8 | public class RunnableTasks { 9 | 10 | public static RunnableTask wrap(ResponseJobStore jobStore, Task task) { 11 | return new DefaultRunningTask(jobStore, task); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/protocol/CodeTypeMappingStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.remoting.protocol; 19 | 20 | /** 21 | * @author zhenyu.nie created on 2019 2019/5/23 20:03 22 | */ 23 | public interface CodeTypeMappingStore { 24 | 25 | Class getMappingType(int code); 26 | } 27 | -------------------------------------------------------------------------------- /bistoury-remoting/src/main/java/qunar/tc/bistoury/remoting/protocol/PayloadHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.remoting.protocol; 19 | 20 | import io.netty.buffer.ByteBuf; 21 | 22 | /** 23 | * @author leix.xie 24 | * @date 2019/5/13 15:11 25 | * @describe 26 | */ 27 | public interface PayloadHolder { 28 | void writeBody(ByteBuf out); 29 | } 30 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/common/BistouryServerConstants.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.serverside.common; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * @author cai.wen created on 19-12-27 上午10:59 7 | */ 8 | public class BistouryServerConstants { 9 | 10 | public static final String PROFILER_ROOT_PATH = System.getProperty("java.io.tmpdir") + File.separator + "bistoury-profiler"; 11 | 12 | public static final String PROFILER_ROOT_TEMP_PATH = PROFILER_ROOT_PATH + File.separator + "tmp"; 13 | 14 | public static final String PROFILER_ROOT_AGENT_PATH = PROFILER_ROOT_PATH + File.separator + "agent"; 15 | } 16 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/configuration/DynamicConfigFactory.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) 2019 Qunar, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package qunar.tc.bistoury.serverside.configuration; 20 | 21 | /** 22 | * @author keli.wang 23 | * @since 2018-11-23 24 | */ 25 | public interface DynamicConfigFactory { 26 | DynamicConfig create(String name, boolean failOnNotExist); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/configuration/Listener.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) 2019 Qunar, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package qunar.tc.bistoury.serverside.configuration; 20 | 21 | /** 22 | * @author keli.wang 23 | * @since 2018-11-27 24 | */ 25 | public interface Listener { 26 | void onLoad(T config); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/jdbc/DataSourceFactory.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.serverside.jdbc; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import qunar.tc.bistoury.serverside.configuration.DynamicConfig; 6 | 7 | public interface DataSourceFactory { 8 | 9 | DataSource createDataSource(DynamicConfig dynamicConfig); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/jdbc/DefaultDataSourceFactory.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.serverside.jdbc; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import qunar.tc.bistoury.serverside.configuration.DynamicConfig; 6 | 7 | /** 8 | * @author xkrivzooh 9 | * @since 2019/8/15 10 | */ 11 | public class DefaultDataSourceFactory implements DataSourceFactory { 12 | 13 | @Override 14 | public DataSource createDataSource(DynamicConfig dynamicConfig) { 15 | org.apache.tomcat.jdbc.pool.DataSource dataSource = new org.apache.tomcat.jdbc.pool.DataSource(); 16 | dataSource.setDriverClassName(dynamicConfig.getString("jdbc.driverClassName", "com.mysql.jdbc.Driver")); 17 | dataSource.setUrl(dynamicConfig.getString("jdbc.url")); 18 | dataSource.setUsername(dynamicConfig.getString("jdbc.username")); 19 | dataSource.setPassword(dynamicConfig.getString("jdbc.password")); 20 | dataSource.setMaxActive(30); 21 | dataSource.setMinIdle(20); 22 | dataSource.setMaxWait(3000); 23 | dataSource.setValidationQuery("select 1"); 24 | dataSource.setTestOnBorrow(true); 25 | dataSource.setTestOnReturn(true); 26 | return dataSource; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/metrics/BistouryCounter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Qunar, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package qunar.tc.bistoury.serverside.metrics; 18 | 19 | /** 20 | * @author keli.wang 21 | * @since 2018/11/21 22 | */ 23 | public interface BistouryCounter { 24 | void inc(); 25 | 26 | void inc(long n); 27 | 28 | void dec(); 29 | 30 | void dec(long n); 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/metrics/BistouryMeter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Qunar, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package qunar.tc.bistoury.serverside.metrics; 18 | 19 | /** 20 | * @author keli.wang 21 | * @since 2018/11/21 22 | */ 23 | public interface BistouryMeter { 24 | void mark(); 25 | 26 | void mark(long n); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/java/qunar/tc/bistoury/serverside/metrics/BistouryTimer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Qunar, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package qunar.tc.bistoury.serverside.metrics; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | /** 22 | * @author keli.wang 23 | * @since 2018/11/21 24 | */ 25 | public interface BistouryTimer { 26 | void update(long duration, TimeUnit unit); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/resources/META-INF/services/qunar.tc.bistoury.serverside.configuration.DynamicConfigFactory: -------------------------------------------------------------------------------- 1 | qunar.tc.bistoury.serverside.configuration.local.LocalDynamicConfigFactory -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/resources/rsa-private-key.pem: -------------------------------------------------------------------------------- 1 | MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALNiAmI+XiW1R069 2 | MjHzK7mLDT6TuMA3KtXNc4nL7jvwSEFp/wygdoe9sfTo99ouOYUlexFkq/1CrlKJ 3 | 5BwuWcbrRS662l6fU1/j3Rq76c8I/76crcvlkGppIICrgZQCeIBFHXBaX1NhbTBq 4 | UEKkPY3ZLDIwu73P4ueF3tq6phLPAgMBAAECgYAyTu50NyGYWbrh7lXBhH1i0Aiq 5 | 4CsUXW R6CeC5aKQr0zuwfNW26NnVP/JEyYGZgxVGrjhRrHY/1Q+mvl1nOeibVOvd 6 | hZVU6aPc1KioqmxAEqlh9sYvWJY0/W6ijZhRCdExrlyX1RBJlZH7yjR06YywcOLz 7 | +NEfcJuba8x7D43fQQJBANuWcqa3/3rZhHwWmaFXKCBJqLejyei14oqjxnyBAktw 8 | nScJqVEBr5gIccrLfQXTf4pIqbTUPL0VkFzU7/2VA/cCQQDRINsla9JtK5oaUF/3 9 | rxYgdZ3/qu6sKPPKKERZFMGZIz/GIYIKiLl9IPqfg+SRMCSD/dFNwkjVz1iBdMoz 10 | qoHpAkEAw0hR4BikWPGW0/AZYpWrNsOrCt3bk1wmAxvRSipFCyg0amI6NLNmILPp 11 | 1usO3Z6Qvz8NxaY1+gZyY0xvvbnHUwJANo2jnTdrRR9Cq+qbnjkGRKFp/e/RIwfr 12 | 0KiAa9yGRDR1xnGnQqg3+vRHbKUzUsyEOgpUNzyfU2crZ1nYBXJNQQJBAKiK7lCs 13 | Cf8hFGNYokuX9+wx0feAdo+OX9aZkpKze4CF2pHrYATH+Di4qETIrbq17WhrYcHT 14 | HetV7bCr9X7nuWs= -------------------------------------------------------------------------------- /bistoury-serverside-common/src/main/resources/rsa-public-key.pem: -------------------------------------------------------------------------------- 1 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzYgJiPl4ltUdOvTIx8yu5iw0+ 2 | k7jANyrVzXOJy+478EhBaf8MoHaHvbH06PfaLjmFJXsRZKv9Qq5SieQcLlnG60Uu 3 | utpen1Nf490au+nPCP++nK3L5ZBqaSCAq4GUAniARR1wWl9TYW0walBCpD2N2Swy 4 | MLu9z+Lnhd7auqYSzwIDAQAB -------------------------------------------------------------------------------- /bistoury-ui-service-impl/src/main/java/qunar/tc/bistoury/ui/dao/GitlabPrivateTokenDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.dao; 19 | 20 | import qunar.tc.bistoury.ui.model.PrivateToken; 21 | 22 | /** 23 | * @author keli.wang 24 | */ 25 | public interface GitlabPrivateTokenDao { 26 | int saveToken(String userId, String privateToken); 27 | 28 | PrivateToken queryToken(final String userId); 29 | } 30 | -------------------------------------------------------------------------------- /bistoury-ui-service-impl/src/main/java/qunar/tc/bistoury/ui/dao/ProfilerDao.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.ui.dao; 2 | 3 | import qunar.tc.bistoury.serverside.bean.Profiler; 4 | 5 | import java.time.LocalDateTime; 6 | import java.util.List; 7 | import java.util.Optional; 8 | 9 | /** 10 | * @author cai.wen created on 2019/10/30 14:52 11 | */ 12 | public interface ProfilerDao { 13 | 14 | List getRecords(String app, String agentId, LocalDateTime startTime); 15 | 16 | Optional getLastRecord(String app, String agentId); 17 | 18 | Profiler getRecordByProfilerId(String profilerId); 19 | } 20 | -------------------------------------------------------------------------------- /bistoury-ui-service-impl/src/main/java/qunar/tc/bistoury/ui/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.dao; 19 | 20 | import qunar.tc.bistoury.ui.model.User; 21 | 22 | /** 23 | * @author leix.xie 24 | * @date 2019/7/4 11:01 25 | * @describe 26 | */ 27 | public interface UserDao { 28 | User getUserByUserCode(String userCode); 29 | 30 | int registerUser(User user); 31 | } 32 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/AESCryptService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.service; 19 | 20 | /** 21 | * @author keli.wang 22 | */ 23 | public interface AESCryptService { 24 | String encrypt(final String data); 25 | 26 | String decrypt(final String data); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/GitRepositoryStoreService.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.ui.service; 2 | 3 | import qunar.tc.bistoury.serverside.bean.ApiResult; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * @author leix.xie 9 | * @date 2019/9/6 18:48 10 | * @describe 11 | */ 12 | public interface GitRepositoryStoreService { 13 | ApiResult file(final String projectId, final String path, final String ref) throws IOException; 14 | 15 | ApiResult fileByClass(final String projectId, final String ref, final String module, final String className) throws IOException; 16 | } 17 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/JarFileStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.service; 19 | 20 | import qunar.tc.bistoury.ui.model.MavenInfo; 21 | 22 | /** 23 | * @author zhenyu.nie created on 2019 2019/4/25 19:10 24 | */ 25 | public interface JarFileStore { 26 | 27 | String getJarFile(MavenInfo mavenInfo); 28 | 29 | String getJarFileIfPresent(MavenInfo mavenInfo); 30 | } 31 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/LoginManager.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.ui.service; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | public interface LoginManager { 7 | void login(String loginId, HttpServletResponse response); 8 | 9 | boolean isLogin(HttpServletRequest request); 10 | 11 | String current(HttpServletRequest request); 12 | 13 | String token(HttpServletRequest request); 14 | 15 | void logout(HttpServletResponse response); 16 | } 17 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/ProfilerService.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.ui.service; 2 | 3 | import qunar.tc.bistoury.serverside.bean.Profiler; 4 | 5 | import java.time.LocalDateTime; 6 | import java.util.List; 7 | import java.util.Optional; 8 | 9 | /** 10 | * @author cai.wen created on 2019/11/4 12:52 11 | */ 12 | public interface ProfilerService { 13 | 14 | Profiler getRecord(String profilerId); 15 | 16 | List getLastRecords(String app, String agentId, LocalDateTime startTime); 17 | 18 | Optional getLastProfilerRecord(String app, String agentId); 19 | } 20 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/URLRedirectService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.service; 19 | 20 | /** 21 | * @author leix.xie 22 | * @date 2019/7/10 15:37 23 | * @describe 24 | */ 25 | public interface URLRedirectService { 26 | String getURLByName(String name); 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/service/UserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.service; 19 | 20 | import qunar.tc.bistoury.ui.model.User; 21 | 22 | /** 23 | * @author leix.xie 24 | * @date 2019/7/4 11:00 25 | * @describe 26 | */ 27 | public interface UserService { 28 | boolean login(User user); 29 | 30 | int register(User user); 31 | 32 | boolean isAdmin(String userCode); 33 | } 34 | -------------------------------------------------------------------------------- /bistoury-ui-service/src/main/java/qunar/tc/bistoury/ui/util/ReleaseInfoParse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Qunar, Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package qunar.tc.bistoury.ui.util; 19 | 20 | import qunar.tc.bistoury.ui.model.ReleaseInfo; 21 | 22 | /** 23 | * @author leix.xie 24 | * @date 2019/7/10 10:45 25 | * @describe 26 | */ 27 | public interface ReleaseInfoParse { 28 | ReleaseInfo parseReleaseInfo(String content); 29 | } 30 | -------------------------------------------------------------------------------- /bistoury-ui/conf/config.properties: -------------------------------------------------------------------------------- 1 | #选填,动态更新,为空时不下载,jar包下载链接,占位符说明: {0}=groupId.replace('.', '/'), {1}=artifactId, {2}=version, 根据实际需求自行拼接 2 | #maven.nexus.url=http://maven.example.com/nexus/public/{0}/{1}/{2}/{1}-{2}-sources.jar 3 | #可选,动态更新,每个jar包保存的时间(天),默认 2 4 | jar.guarantee.period.days=2 5 | #可选,动态更新,管理员用户,默认空 6 | admins=admin 7 | #必填,动态更新,验证agent是否在当前proxy,%s使用proxyIp替换,%d使用tomcat端口替换 8 | agent.proxy=http://%s:%d/proxy/agent/get 9 | #必填,动态更新,agent meta info刷新接口,%s使用proxyIp替换,%d使用tomcat端口替换 10 | agent.meta.refresh=http://%s:%d/proxy/agent/metaRefresh 11 | #选填,填写错误时不生效,获取源码的仓库类型,值为gitlabv3和github 12 | #git.repository=github 13 | #选填,为空时不生效,git地址,用户从git仓库拿代码,gitlab填写首页地址,github填写api地址(https://api.github.com) 14 | #git.endpoint=https://api.github.com 15 | #可选,git 获取源码的文件路径,{0}=module/ 当module为[.]时,{0}为"", {1}=className.replace(".","/"),根据需求自行拼接,默认 {0}src/main/java/{1}.java 16 | file.path.format={0}src/main/java/{1}.java 17 | #可选,动态更新,当前最新agent版本,默认1.0 18 | agent.lastVersion=1.0 -------------------------------------------------------------------------------- /bistoury-ui/conf/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://127.0.0.1:3306/bistoury?characterEncoding=utf8&rewriteBatchedStatements=true&allowMultiQueries=true&cachePrepStmts=true&cacheResultSetMetadata=true&cacheServerConfiguration=true&useServerPrepStmts=true 3 | jdbc.username=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /bistoury-ui/conf/prometheus.properties: -------------------------------------------------------------------------------- 1 | #监控类型,默认使用prometheus实现 2 | monitor.type=prometheus 3 | #监控数据抓取路径,默认ip:port/metrics 4 | monitor.action=metrics 5 | #监控数据抓取端口,默认3333 6 | monitor.port=3333 7 | #另外也提供了Graphite方式的接入,只需要在里按照如下配置即可: 8 | #monitor.type=graphite 9 | #graphite.host= 10 | #graphite.port= -------------------------------------------------------------------------------- /bistoury-ui/conf/registry.properties: -------------------------------------------------------------------------------- 1 | #必填,proxy机器注册的zk地址 2 | default=127.0.0.1:2181 3 | -------------------------------------------------------------------------------- /bistoury-ui/conf/server.properties: -------------------------------------------------------------------------------- 1 | tomcat.port=9091 2 | tomcat.basedir=/tmp/bistoury/tomcat/ui 3 | 4 | -------------------------------------------------------------------------------- /bistoury-ui/conf/url_redirect.properties: -------------------------------------------------------------------------------- 1 | #全部动态更新 2 | #如果是跨域跳转,请带上http或https 3 | #动态监控使用说明文档链接 4 | monitor.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/monitor.md 5 | #在线Debug使用说明文档链接 6 | debug.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/debug.md 7 | #线程级cpu监控使用文档链接 8 | jstack.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/jstack.md 9 | #堆内存对象概览文档链接 10 | jmap.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/jmap.md 11 | #git private token获取超链接 12 | gitlab.private.token.url=https://github.com/settings/tokens 13 | #bistoury 开发环境地址 14 | bistoury.ui.dev=http://bistoury.dev.example.com 15 | #bistoury 测试环境地址 16 | bistoury.ui.beta=http://bistoury.beta.example.com 17 | #bistoury 线上环境地址 18 | bistoury.ui.prod=http://bistoury.prod.example.com 19 | -------------------------------------------------------------------------------- /bistoury-ui/src/bin/base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | TIMESTAMP=$(date +%s) 5 | BISTOURY_COF_DIR="$BISTOURY_BIN_DIR/../conf" 6 | BISTOURY_PID_DIR="$BISTOURY_BIN_DIR/../pid" 7 | BISTOURY_LOG_DIR="$BISTOURY_BIN_DIR/../logs" 8 | BISTOURY_CACHE_DIR="$BISTOURY_BIN_DIR/../cache" 9 | 10 | if [[ ! -w "$BISTOURY_PID_DIR" ]] ; then 11 | mkdir -p "$BISTOURY_PID_DIR" 12 | fi 13 | 14 | if [[ ! -w "$BISTOURY_LOG_DIR" ]] ; then 15 | mkdir -p "$BISTOURY_LOG_DIR" 16 | fi 17 | 18 | CLASSPATH="$BISTOURY_COF_DIR" 19 | for i in "$BISTOURY_BIN_DIR"/../lib/* 20 | do 21 | CLASSPATH="$i:$CLASSPATH" 22 | done -------------------------------------------------------------------------------- /bistoury-ui/src/bin/bistoury-ui-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | JAVA_HOME="/tmp/bistoury/java" 5 | JAVA_OPTS="-Dbistoury.conf=$BISTOURY_COF_DIR -Dbistoury.cache=$BISTOURY_CACHE_DIR" 6 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/java/qunar/tc/bistoury/ui/filter/XssFilter.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.ui.filter; 2 | 3 | import javax.servlet.*; 4 | import javax.servlet.http.HttpServletRequest; 5 | import java.io.IOException; 6 | 7 | /** 8 | * @author leix.xie 9 | * @date 2020/4/4 14:19 10 | * @describe 11 | */ 12 | public class XssFilter implements Filter { 13 | @Override 14 | public void init(FilterConfig filterConfig) throws ServletException { 15 | 16 | } 17 | 18 | @Override 19 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { 20 | chain.doFilter(new XSSRequestWrapper((HttpServletRequest) request), response); 21 | } 22 | 23 | @Override 24 | public void destroy() { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/resources/META-INF/services/qunar.tc.bistoury.serverside.jdbc.DataSourceFactory: -------------------------------------------------------------------------------- 1 | qunar.tc.bistoury.serverside.jdbc.DefaultDataSourceFactory -------------------------------------------------------------------------------- /bistoury-ui/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | [%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5p %c:%L] %m%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/resources/spring/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/resources/spring/service.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/chosen-sprite.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/cpu-profiler.css: -------------------------------------------------------------------------------- 1 | .svg-page { 2 | display: flex; 3 | } 4 | 5 | .svg-page-sidebar { 6 | width: 15%; 7 | } 8 | 9 | .svg-page-content { 10 | width: 80%; 11 | } 12 | 13 | .cpu-profiler-container { 14 | height: 20px; 15 | margin: 20px auto 0; 16 | border: 2px solid #388bfb; 17 | line-height: 20px; 18 | border-radius: 10px; 19 | -webkit-border-radius: 10px; 20 | -moz-border-radius: 10px; 21 | overflow: hidden; 22 | } 23 | 24 | .cpu-profiler-process { 25 | background: #85B9FF; 26 | height: 100%; 27 | text-align: center; 28 | transition: all 0.5s ease-in-out; 29 | -webkit-transition: all 0.5s ease-in-out; 30 | -moz-transition: all 0.5s ease-in-out; 31 | color: #fff; 32 | } -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/help.less: -------------------------------------------------------------------------------- 1 | .markdown-preview.markdown-preview { 2 | // modify your style here 3 | // eg: background-color: blue; 4 | pre[class*="language-"] { 5 | overflow: auto; 6 | } 7 | 8 | figure, p { 9 | margin: 0; 10 | } 11 | 12 | blockquote { 13 | margin: 0; 14 | } 15 | } 16 | 17 | html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview { 18 | padding: 2em !important; 19 | top: 45px !important; 20 | position: fixed; 21 | overflow: auto; 22 | height: calc(100% - 45px) !important; 23 | } 24 | 25 | @media screen and (min-width: 914px) { 26 | html body[for="html-export"]:not([data-presentation-mode]) .markdown-preview { 27 | padding: 2em 5em !important; 28 | position: fixed; 29 | overflow: auto; 30 | top: 45px; 31 | height: calc(100% - 45px) !important; 32 | } 33 | } 34 | 35 | html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc { 36 | top: 45px !important; 37 | height: calc(100% - 45px) !important; 38 | padding: 10px 0 20px 0; 39 | } -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/jstree/32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/jstree/32px.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/jstree/40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/jstree/40px.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/jstree/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/css/jstree/throbber.gif -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/css/monitor.css: -------------------------------------------------------------------------------- 1 | .daterangepicker_end_input { 2 | padding-left: 0px !important; 3 | } 4 | 5 | .range_inputs input { 6 | height: 32px !important; 7 | border-radius: 0px !important; 8 | } 9 | 10 | .monitor-input { 11 | height: 32px !important; 12 | border-radius: 0px; 13 | } 14 | 15 | .monitor-input[disabled] { 16 | cursor: auto; 17 | background-color: #fff; 18 | } 19 | 20 | .monitor-label { 21 | padding-right: 10px; 22 | font-size: 16px; 23 | padding-top: 6px; 24 | } 25 | 26 | .list-group a { 27 | border-radius: 0px !important; 28 | } -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/androidstudio.css: -------------------------------------------------------------------------------- 1 | /* 2 | Date: 24 Fev 2015 3 | Author: Pedro Oliveira 4 | */ 5 | 6 | .hljs { 7 | color: #a9b7c6; 8 | background: #282b2e; 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | } 13 | 14 | .hljs-number, 15 | .hljs-literal, 16 | .hljs-symbol, 17 | .hljs-bullet { 18 | color: #6897BB; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-deletion { 24 | color: #cc7832; 25 | } 26 | 27 | .hljs-variable, 28 | .hljs-template-variable, 29 | .hljs-link { 30 | color: #629755; 31 | } 32 | 33 | .hljs-comment, 34 | .hljs-quote { 35 | color: #808080; 36 | } 37 | 38 | .hljs-meta { 39 | color: #bbb529; 40 | } 41 | 42 | .hljs-string, 43 | .hljs-attribute, 44 | .hljs-addition { 45 | color: #6A8759; 46 | } 47 | 48 | .hljs-section, 49 | .hljs-title, 50 | .hljs-type { 51 | color: #ffc66d; 52 | } 53 | 54 | .hljs-name, 55 | .hljs-selector-id, 56 | .hljs-selector-class { 57 | color: #e8bf6a; 58 | } 59 | 60 | .hljs-emphasis { 61 | font-style: italic; 62 | } 63 | 64 | .hljs-strong { 65 | font-weight: bold; 66 | } 67 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/ascetic.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: white; 12 | color: black; 13 | } 14 | 15 | .hljs-string, 16 | .hljs-variable, 17 | .hljs-template-variable, 18 | .hljs-symbol, 19 | .hljs-bullet, 20 | .hljs-section, 21 | .hljs-addition, 22 | .hljs-attribute, 23 | .hljs-link { 24 | color: #888; 25 | } 26 | 27 | .hljs-comment, 28 | .hljs-quote, 29 | .hljs-meta, 30 | .hljs-deletion { 31 | color: #ccc; 32 | } 33 | 34 | .hljs-keyword, 35 | .hljs-selector-tag, 36 | .hljs-section, 37 | .hljs-name, 38 | .hljs-type, 39 | .hljs-strong { 40 | font-weight: bold; 41 | } 42 | 43 | .hljs-emphasis { 44 | font-style: italic; 45 | } 46 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/brown-paper.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Brown Paper style from goldblog.com.ua (c) Zaripov Yura 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background:#b7a68e url(./brown-papersq.png); 12 | } 13 | 14 | .hljs-keyword, 15 | .hljs-selector-tag, 16 | .hljs-literal { 17 | color:#005599; 18 | font-weight:bold; 19 | } 20 | 21 | .hljs, 22 | .hljs-subst { 23 | color: #363c69; 24 | } 25 | 26 | .hljs-string, 27 | .hljs-title, 28 | .hljs-section, 29 | .hljs-type, 30 | .hljs-attribute, 31 | .hljs-symbol, 32 | .hljs-bullet, 33 | .hljs-built_in, 34 | .hljs-addition, 35 | .hljs-variable, 36 | .hljs-template-tag, 37 | .hljs-template-variable, 38 | .hljs-link, 39 | .hljs-name { 40 | color: #2c009f; 41 | } 42 | 43 | .hljs-comment, 44 | .hljs-quote, 45 | .hljs-meta, 46 | .hljs-deletion { 47 | color: #802022; 48 | } 49 | 50 | .hljs-keyword, 51 | .hljs-selector-tag, 52 | .hljs-literal, 53 | .hljs-doctag, 54 | .hljs-title, 55 | .hljs-section, 56 | .hljs-type, 57 | .hljs-name, 58 | .hljs-strong { 59 | font-weight: bold; 60 | } 61 | 62 | .hljs-emphasis { 63 | font-style: italic; 64 | } 65 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/brown-papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/highlight/styles/brown-papersq.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/codepen-embed.css: -------------------------------------------------------------------------------- 1 | /* 2 | codepen.io Embed Theme 3 | Author: Justin Perry 4 | Original theme - https://github.com/chriskempson/tomorrow-theme 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #222; 12 | color: #fff; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #777; 18 | } 19 | 20 | .hljs-variable, 21 | .hljs-template-variable, 22 | .hljs-tag, 23 | .hljs-regexp, 24 | .hljs-meta, 25 | .hljs-number, 26 | .hljs-built_in, 27 | .hljs-builtin-name, 28 | .hljs-literal, 29 | .hljs-params, 30 | .hljs-symbol, 31 | .hljs-bullet, 32 | .hljs-link, 33 | .hljs-deletion { 34 | color: #ab875d; 35 | } 36 | 37 | .hljs-section, 38 | .hljs-title, 39 | .hljs-name, 40 | .hljs-selector-id, 41 | .hljs-selector-class, 42 | .hljs-type, 43 | .hljs-attribute { 44 | color: #9b869b; 45 | } 46 | 47 | .hljs-string, 48 | .hljs-keyword, 49 | .hljs-selector-tag, 50 | .hljs-addition { 51 | color: #8f9c6c; 52 | } 53 | 54 | .hljs-emphasis { 55 | font-style: italic; 56 | } 57 | 58 | .hljs-strong { 59 | font-weight: bold; 60 | } 61 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Dark style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #444; 12 | } 13 | 14 | .hljs-keyword, 15 | .hljs-selector-tag, 16 | .hljs-literal, 17 | .hljs-section, 18 | .hljs-link { 19 | color: white; 20 | } 21 | 22 | .hljs, 23 | .hljs-subst { 24 | color: #ddd; 25 | } 26 | 27 | .hljs-string, 28 | .hljs-title, 29 | .hljs-name, 30 | .hljs-type, 31 | .hljs-attribute, 32 | .hljs-symbol, 33 | .hljs-bullet, 34 | .hljs-built_in, 35 | .hljs-addition, 36 | .hljs-variable, 37 | .hljs-template-tag, 38 | .hljs-template-variable { 39 | color: #d88; 40 | } 41 | 42 | .hljs-comment, 43 | .hljs-quote, 44 | .hljs-deletion, 45 | .hljs-meta { 46 | color: #777; 47 | } 48 | 49 | .hljs-keyword, 50 | .hljs-selector-tag, 51 | .hljs-literal, 52 | .hljs-title, 53 | .hljs-section, 54 | .hljs-doctag, 55 | .hljs-type, 56 | .hljs-name, 57 | .hljs-strong { 58 | font-weight: bold; 59 | } 60 | 61 | .hljs-emphasis { 62 | font-style: italic; 63 | } 64 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/darkula.css: -------------------------------------------------------------------------------- 1 | /* 2 | Deprecated due to a typo in the name and left here for compatibility purpose only. 3 | Please use darcula.css instead. 4 | */ 5 | 6 | @import url('darcula.css'); 7 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/mono-blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | Five-color theme from a single blue hue. 3 | */ 4 | .hljs { 5 | display: block; 6 | overflow-x: auto; 7 | padding: 0.5em; 8 | background: #eaeef3; 9 | } 10 | 11 | .hljs { 12 | color: #00193a; 13 | } 14 | 15 | .hljs-keyword, 16 | .hljs-selector-tag, 17 | .hljs-title, 18 | .hljs-section, 19 | .hljs-doctag, 20 | .hljs-name, 21 | .hljs-strong { 22 | font-weight: bold; 23 | } 24 | 25 | .hljs-comment { 26 | color: #738191; 27 | } 28 | 29 | .hljs-string, 30 | .hljs-title, 31 | .hljs-section, 32 | .hljs-built_in, 33 | .hljs-literal, 34 | .hljs-type, 35 | .hljs-addition, 36 | .hljs-tag, 37 | .hljs-quote, 38 | .hljs-name, 39 | .hljs-selector-id, 40 | .hljs-selector-class { 41 | color: #0048ab; 42 | } 43 | 44 | .hljs-meta, 45 | .hljs-subst, 46 | .hljs-symbol, 47 | .hljs-regexp, 48 | .hljs-attribute, 49 | .hljs-deletion, 50 | .hljs-variable, 51 | .hljs-template-variable, 52 | .hljs-link, 53 | .hljs-bullet { 54 | color: #4c81c9; 55 | } 56 | 57 | .hljs-emphasis { 58 | font-style: italic; 59 | } 60 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/highlight/styles/pojoaque.jpg -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/highlight/styles/school-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/highlight/styles/school-book.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/image/tcdev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/bistoury-ui/src/main/webapp/image/tcdev.png -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/js/mode-ecb.js: -------------------------------------------------------------------------------- 1 | /* 2 | CryptoJS v3.1.2 3 | code.google.com/p/crypto-js 4 | (c) 2009-2013 by Jeff Mott. All rights reserved. 5 | code.google.com/p/crypto-js/wiki/License 6 | */ 7 | /** 8 | * Electronic Codebook block mode. 9 | */ 10 | CryptoJS.mode.ECB = (function () { 11 | var ECB = CryptoJS.lib.BlockCipherMode.extend(); 12 | 13 | ECB.Encryptor = ECB.extend({ 14 | processBlock: function (words, offset) { 15 | this._cipher.encryptBlock(words, offset); 16 | } 17 | }); 18 | 19 | ECB.Decryptor = ECB.extend({ 20 | processBlock: function (words, offset) { 21 | this._cipher.decryptBlock(words, offset); 22 | } 23 | }); 24 | 25 | return ECB; 26 | }()); 27 | -------------------------------------------------------------------------------- /bistoury-ui/src/main/webapp/redirectError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bistoury Error 8 | 9 | 10 |
11 |

页面跳转失败,请联系管理员检查配置文件

12 |
13 | 14 | -------------------------------------------------------------------------------- /bistoury-ui/src/test/java/qunar/tc/bistoury/ui/container/UiBootstrapForTest.java: -------------------------------------------------------------------------------- 1 | package qunar.tc.bistoury.ui.container; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * @author xkrivzooh 9 | * @since 2019/8/15 10 | */ 11 | public class UiBootstrapForTest { 12 | 13 | @Test 14 | public void bootstrap() { 15 | String bistouryConfPath = UiBootstrapForTest.class.getResource("/conf").getPath().toString(); 16 | System.setProperty("bistoury.conf", bistouryConfPath); 17 | try { 18 | Bootstrap.main(new String[]{}); 19 | } 20 | catch (Exception e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | 25 | 26 | } -------------------------------------------------------------------------------- /bistoury-ui/src/test/java/qunar/tc/bistoury/ui/git/github.http: -------------------------------------------------------------------------------- 1 | # For a quick start check out our HTTP Requests collection (Tools|HTTP Client|Open HTTP Requests Collection) or 2 | # paste cURL into the file and request will be converted to HTTP Request format. 3 | # 4 | # Following HTTP Request Live Templates are available: 5 | # * 'gtrp' and 'gtr' create a GET request with or without query parameters; 6 | # * 'ptr' and 'ptrp' create a POST request with a simple or parameter-like body; 7 | # * 'mptr' and 'fptr' create a POST request to submit a form with a text or file field (multipart/form-data); 8 | 9 | GET https://api.github.com/users/xleiy/repos 10 | #Accept:application/vnd.github.mercy-preview+json 11 | ### -------------------------------------------------------------------------------- /bistoury-ui/src/test/resources/conf/config.properties: -------------------------------------------------------------------------------- 1 | #必填,动态更新,jar包下载链接,占位符说明: {0}=groupId.replace('.', '/'), {1}=artifactId, {2}=version, 根据实际需求自行拼接 2 | maven.nexus.url=http://maven.example.com/nexus/public/{0}/{1}/{2}/{1}-{2}-sources.jar 3 | #可选,动态更新,git 获取源码的文件路径,{0}=module/ 当module为[.]时,{0}为"", {1}=className.replace(".","/"),根据需求自行拼接,默认 {0}src/main/java/{1}.java 4 | file.path.format={0}src/main/java/{1}.java 5 | #可选,动态更新,每个jar包保存的时间(天),默认 2 6 | jar.guarantee.period.days=2 7 | #可选,动态更新,管理员用户,默认空 8 | admins=admin 9 | #必填,动态更新,验证agent是否在当前proxy,%s使用proxyIp替换,%d使用tomcat端口替换 10 | agent.proxy=http://%s:%d/proxy/agent/get 11 | #必填,动态更新,agent meta info刷新接口,%s使用proxyIp替换,%d使用tomcat端口替换 12 | agent.meta.refresh=http://%s:%d/proxy/agent/metaRefresh 13 | #必填,动态更新,gitlab地址,用户从git仓库拿代码 14 | git.endpoint=http://code.example.com 15 | #可选,动态更新,当前最新agent版本,默认1.0 16 | agent.lastVersion=1.0 -------------------------------------------------------------------------------- /bistoury-ui/src/test/resources/conf/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=com.mysql.jdbc.Driver 2 | jdbc.url=jdbc:mysql://127.0.0.1:3306/bistoury?characterEncoding=utf8&rewriteBatchedStatements=true&allowMultiQueries=true&cachePrepStmts=true&cacheResultSetMetadata=true&cacheServerConfiguration=true&useServerPrepStmts=true 3 | jdbc.username=root 4 | jdbc.password=root -------------------------------------------------------------------------------- /bistoury-ui/src/test/resources/conf/prometheus.properties: -------------------------------------------------------------------------------- 1 | #监控类型,默认使用prometheus实现 2 | monitor.type=prometheus 3 | #监控数据抓取路径,默认ip:port/metrics 4 | monitor.action=metrics 5 | #监控数据抓取端口,默认3333 6 | monitor.port=3333 7 | #另外也提供了Graphite方式的接入,只需要在里按照如下配置即可: 8 | #monitor.type=graphite 9 | #graphite.host= 10 | #graphite.port= -------------------------------------------------------------------------------- /bistoury-ui/src/test/resources/conf/registry.properties: -------------------------------------------------------------------------------- 1 | #必填,proxy机器注册的zk地址 2 | default=127.0.0.1:2181 3 | -------------------------------------------------------------------------------- /bistoury-ui/src/test/resources/conf/server.properties: -------------------------------------------------------------------------------- 1 | tomcat.port=9091 2 | tomcat.basedir=/tmp/tomcat 3 | 4 | -------------------------------------------------------------------------------- /bistoury-ui/src/test/resources/conf/url_redirect.properties: -------------------------------------------------------------------------------- 1 | #全部动态更新,默认值均为空 2 | #如果是跨域跳转,请带上http或https 3 | #动态监控使用说明文档链接 4 | monitor.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/monitor.md 5 | #在线Debug使用说明文档链接 6 | debug.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/debug.md 7 | #线程级cpu监控使用文档链接 8 | jstack.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/jstack.md 9 | #堆内存对象概览文档链接 10 | jmap.help.url=https://github.com/qunarcorp/bistoury/blob/master/docs/cn/jmap.md 11 | #git private token获取超链接 12 | gitlab.private.token.url= 13 | #bistoury 开发环境地址 14 | bistoury.ui.dev=http://bistoury.dev.example.com 15 | #bistoury 测试环境地址 16 | bistoury.ui.beta=http://bistoury.beta.example.com 17 | #bistoury 线上环境地址 18 | bistoury.ui.prod=http://bistoury.prod.example.com 19 | -------------------------------------------------------------------------------- /docs/cn/application.md: -------------------------------------------------------------------------------- 1 | # 应用中心 2 | 3 | 在前面说过,Bistoury不仅仅可以从机器的维度,还可以从应用的维度对系统进行诊断。 4 | 5 | ## 应用是什么 6 | 7 | 我们知道,在线系统往往部署在多台机器上,应用就是与系统相关的这些机器以及所使用到的资源的一个集合。 8 | 9 | 应用中心就是用来管理应用信息的一个东西,而Bistoury需要从应用中心获取应用与机器、应用与人等各种信息。 10 | 11 | Bistoury在ui内部集成了一个简单的应用中心,如果公司内部有自己的应用中心,应该实现`bistoury-application-api`模块中的接口接入自己的应用中心。 12 | 13 | ## 功能说明 14 | 15 | 应用中心主要职责如下: 16 | - 人/应用/服务器之间的关系 17 | - 应用/服务器的信息 18 | 19 | ## 使用说明 20 | - 点击【应用中心】进入应用中心页面,这里会展示当前登录用户的所有应用 21 | ![app](../image/app_panel.png) 22 | - 点击【新增】可以新增一个应用,新增应用时会默认将当前登录用户添加到应用负责人中. 23 | ![app_add](../image/app_add.png) 24 | - 点击【管理】可以对应用信息进行管理,可以修改应用信息 25 | ![app_info](../image/app_info.png) 26 | - 点击【服务器管理】tab也可以对当前应用的服务器信息进行管理,点击列表中的开关可以对线程级cpu监控等功能进行管理 27 | ![app_server](../image/app_server.png) 28 | - 点击新增按钮可以新增服务器,管理按钮可以对服务器信息进行管理。其中端口号用于agent与应用进行连接,日志目录用于查看日志 29 | ![app_server_manger](../image/app_server_manger.png) -------------------------------------------------------------------------------- /docs/cn/design.md: -------------------------------------------------------------------------------- 1 | # 架构概览 2 | 下图是bistoury中各个组件及其交互图 3 | - ui提供是用户操作的入口,用户的所有操作均在ui上完成。 4 | - proxy是一个中间代理层,会将所有的用户操作转发到对应主机的agent上,并将agent的响应返回给ui。 5 | - agent是部署在应用主机上,接受来自proxy转发的用户请求,并给出对应的响应。 6 | - zookeeper用于服务发现,proxy将自己的信息注册到zk,ui在上面获取在线的proxy。 7 | 8 | ![组件交互图](../image/design.png) 9 | - 1、proxy启动并将自己的ip端口信息注册到zookeeper 10 | - 2、agent启动并通过proxy的域名向proxy请求netty连接信息 11 | - 3、收到请求的proxy返回自身的netty连接信息 12 | - 4、agent根据获取到的netty连接信息连接proxy,并保持一个心跳 13 | - 5、ui从zk上获取所有proxy的ip端口信息 14 | - 6、请求proxy,确认我要连接的agent是否在当前proxy上 15 | - 7、返回agent是否连接在本机的结果 16 | - 8、ui使用websocket发送命令到proxy 17 | - 9、proxy对命令进行初步加工校验后将命令转发到agent 18 | - 10、agent返回命令的处理结果 19 | - 11、proxy返回命令结果 20 | 21 | -------------------------------------------------------------------------------- /docs/cn/downloadFile.md: -------------------------------------------------------------------------------- 1 | ## 文件下载 2 | 在使用文件下载前,需要管理员配置`download_dir_limit.properties`文件,以确定哪些文件是可以下载的 3 | 4 | 除了配置全局的文件下载限制外,可针对单个appcode配置各自的下载目录 5 | 6 | ```properties 7 | #文件下载文件夹限制,只能在指定目录下下载,可以对每个appcode进行单独限制 8 | 9 | #文件下载文件夹限制, 全局默认值, 多个文件夹使用英文逗号(,)分隔,dump文件夹。/tmp/bistoury-class-dump位于com/taobao/arthas/core/advisor/Enhancer.java:209中修改 10 | default.download.dump.dir=/tmp/bistoury/qjtools/qjdump,/tmp/bistoury-class-dump 11 | #文件下载文件夹限制,全局默认值, 多个文件夹使用英文逗号(,)分隔,其他文件夹 12 | default.download.other.dir=/tmp/bistoury/other 13 | 14 | #针对appcode进行限制 15 | #文件下载文件夹限制, 针对appcode限制, 多个文件夹使用英文逗号(,)分隔,dump文件夹 16 | #appcode.download.dump.dir=/tmp/bistoury/qjtools/qjdump 17 | #文件下载文件夹限制,针对appcode限制, 多个文件夹使用英文逗号(,)分隔,其他文件夹 18 | #appcode.download.other.dir=/Users/leix.xie/Downloads/ 19 | ``` 20 | 21 | 提示: 22 | 23 | - 配置文件中的所配置的路径均为临时目录,如果需要上线,请务必根据实际情况修改目录 24 | - 需要dump 插桩后的class文件的话,请移步修改com/taobao/arthas/core/advisor/Enhancer.java:209中的dump路径 25 | -------------------------------------------------------------------------------- /docs/cn/java11.md: -------------------------------------------------------------------------------- 1 | # Bistoury支持Java 11 2 | 部分公司已经开始使用Java11,bistoury开始对Java 11进行支持,如果在使用过程中遇到问题可以在issues中反馈。 3 | 4 | 为了支持Java11,bistoury在功能上进行了取舍,bistoury 不再支持qjtop、qjmap、qjmxcli命令。 5 | - qjtop用于查看JVM指标及繁忙线程,删除这个命令后可到主机信息页面查看 JVM 指标及繁忙线程 6 | - qjmap用于分代打印内存信息,删除之后可以使用heapdump命令dump内存信息 7 | - qjmxcli JMX 查看工具,删除之后可以使用mbean命令查看mxbean信息 8 | 9 | **注意**:当Java版本高于Java8时,启动agent时,请在启动参数添加` --add-opens=java.base/jdk.internal.perf=ALL-UNNAMED` 10 | 11 | **注意** 当agent和应用的java版本不一致时,可能会出错,建议agent和应用使用相同的大版本。 12 | -------------------------------------------------------------------------------- /docs/cn/jmap.md: -------------------------------------------------------------------------------- 1 | 堆内存对象监控 2 | 当线上遇到OOM时,我们首先想到的是heap dump,然后通过分析dump文件定位问题,但是如果有人先你一步重启了应用,导致现场破坏,下一次遇到这个问题不知道是什么时候了。 3 | 4 | 堆内存对象监控可以有效的解决这个问题,堆对象监控监控每分钟会抓取一次每个class的实例数目、内存占用、类全名信息,提供最近三天的数据查询,这样,在应用重启后,我们依然可以获取到出现堆内对象使用情况。 5 | 6 | ## 实现 7 | 为了支持历史的数据查询,bistoury会在agent上启动一个定时任务,每分钟进行一次jmap,考虑到jmap -histo:live会触发一次full gc,所以使用jmap -histo获取对内存对象信息,将占用内存空间最大的100个对象信息存入rocksDB。 8 | 9 | 进行jmap时,bistoury会先通过pid attach到jvm,然后调用HotSpotVirtualMachine#heapHisto获取堆内存对象信息。 10 | 11 | ## 使用 12 | - 进入主机信息页面 13 | - 选择需要查看的应用、服务器 14 | - 点击【jvm信息】 15 | - 点击【堆对象统计】 16 | - 点击刷新图标查询数据 17 | 18 | **注意** -live参数会统计堆中存活的对象信息,回触发一次full gc,请谨慎选择。 19 | 20 | ![jmap_panel](../image/jmap_panel.png) -------------------------------------------------------------------------------- /docs/cn/jstack.md: -------------------------------------------------------------------------------- 1 | # 线程级cpu监控 2 | 3 | 在系统的日常运维中,我们有时会碰到cpu使用率突然飙高的情况。这个时候我们会登录机器,top查看进程id,top -h查看消耗cpu的线程id,然后jstack看看对应的线程是哪一个,最后再进行具体分析。 4 | 暂且不考虑这一系列操作需要的时间,我们收到报警的时候可能正在公司外吃饭,或是正在睡觉,而等我们做好准备登录上机器时问题已经结束了,现场没了,我们还能做的就只是看着机器的cpu监控图一脸茫然... 5 | 6 | 当遇到这些情况时,你会发现你需要的是线程级cpu使用率监控帮你指出问题线程,而不是传统的机器cpu使用率监控让你只能看着监控图一脸懵逼。 7 | 8 | Bistoury就是你需要的那一个!我们提供了线程级的cpu使用率监控,它在本地保存了最近三天的线程级监控数据,还对每个线程每一分钟提供一个瞬时的线程调用栈。 9 | 10 | ## 系统 11 | 12 | 目前线程级cpu监控仅支持linux系统,mac系统尚不支持 13 | 14 | ## 使用 15 | - 进入主机信息页面 16 | - 选择需要查看的应用、机器 17 | - 点击 【线程级cpu监控】 18 | ![jstack_entry](../image/jstack_entry.png) 19 | 20 | 线程级cpu监控主要分为两个区域,区域一是线程数量和cpu占比的折线图,区域二是线程完整信息。 21 | ![jstack_panel](../image/jstack_panel.png) 22 | 23 | ### 区域一 24 | 25 | 可以单独查看某一线程的cpu占比,也可以查看不同时间的cpu占比(支持最近三天),点击某一时间对应的点,可以在区域二展示具体的线程信息。 26 | ![jstack_cpu_thread](../image/jstack_cpu_thread.png) 27 | 28 | ### 区域二 29 | 30 | 可以按照线程名、线程调用栈、线程状态对线程进行筛选,其中每分钟cpu占用率是该分钟内cpu使用占比,瞬时cpu使用占比,是指抓取数据时cpu瞬时cpu使用率占比。 31 | ![jstack_thread_search](../image/jstack_thread_search.png) 32 | stacktrace按钮展示 33 | ![jstack_thread_stacktrace](../image/jstack_thread_stacktrace.png) 34 | -------------------------------------------------------------------------------- /docs/cn/monitor.md: -------------------------------------------------------------------------------- 1 | # 动态监控 2 | 3 | 有时候我们需要对系统的某个方法添加一个监控看看系统运行情况,但经历一次修改代码、qa检查、重新发布的流程又感觉不划算,这就是动态监控大显身手的时候了。 4 | 动态监控类似于Arthas的monitor方法,会对方法的执行时间、调用次数、失败次数进行监控,不同之处在于会生成对应的监控图,保留最近几天的数据,并且提供了web界面,通过类似添加断点的方式来添加监控。 5 | 6 | **注意:** 监控会使用部分应用程序内存,建议内存较小的应用不要添加过多的动态监控。 7 | 8 | ## 监控生命周期 9 | 10 | 动态监控添加的指标生命周期与应用的的生命周期基本一致,从添加开始一直到应用停止,监控回一直采集监控数据。并存储最近三天的历史数据。 11 | 12 | ## 使用 13 | 14 | - 进入动态监控页面,初次使用时请先点击下方链接设置git private token,若不设置,则添加断点时的代码将会通过反编译产生。目前仅支持gitlab,点击输入框下方对应链接获取,然后点击保存设置private token。 15 | ![private token](../image/private_token.png) 16 | - 选择需要添加监控的应用名,再选择需要在哪台机器上添加监控,然后点击【选择】按钮,进入已加载类列表 17 | ![monitor_entry](../image/monitor_entry.png) 18 | - 找到需要添加的类(支持搜索),点击【监控】按钮进入监控页面。类列表是在attach时获取的应用已加载的类。 19 | 20 | 如果在attach之后有新的类加载(有时在列表中找不到自己想要的类,可能就是你要的类是在attach之后再加载的),可以通过点击【重新加载】加载按钮对列表进行重新加载。刷新按钮只会重新请求列表,不会重新加载。 21 | 22 | 选择“只加载新加载的类”只会加载应用中新加载的类; 23 | 24 | 选择“全部加载”会把整个列表重新加载一遍。 25 | ![monitor_class_list](../image/monitor_class_list.png) 26 | - 找到需要添加监控的方法,在其中任意语句添加标记,点击前方的行号标记所在行。对于内部类,需要内部类代码被执行过(**保证类被加载**)才能添加监控 27 | ![monitor_panel](../image/monitor_panel.png) 28 | - 在监控首页可以选择应用及机器后可以查看监控数据 29 | ![monitor_display](../image/monitor_display.png) 30 | -------------------------------------------------------------------------------- /docs/cn/profiler.md: -------------------------------------------------------------------------------- 1 | # 性能分析 2 | 3 | ## 前提 4 | 升级bistoury到最新版 5 | 6 | ## 保存时间 7 | 性能分析结果默认只保存三天 8 | 9 | ## bistoury中的性能分析 10 | 11 | 目前对java应用进行性能分析的方法主要有三种,插桩统计,同步抽样,异步抽样。 12 | 在这里面,插桩统计堆应用性能影响过大,基本无法接受;异步抽样无论从性能影响还是准确性上都比同步抽样要更好。 13 | 因此,bistoury选用了基于[async-profiler](https://github.com/jvm-profiling-tools/async-profiler)的异步抽样,并在操作、配置和结果处理上做了一系列优化,开发人员可以一键对应用进行cpu profiling。 14 | 15 | 16 | ## 如何开始 17 | `主机信息`里面点击`性能分析`, 18 | 19 | ![如何开始](../image/profiler_start.png) 20 | 21 | 选择抽样持续时间,就可以对应用程序进行性能分析(建议在应用运行一段时间后再进行,防止结果被jit影响) 22 | ![如何开始](../image/profiler_start_step_2.png) 23 | 24 | 查看结果: 25 | 26 | ### 火焰图 27 | ![性能分析栈](../image/profiler_stack.png) 28 | 29 | ### java热点方法 30 | ![性能分析方法](../image/profiler_method.png) 31 | 32 | ## 系统支持 33 | 支持 Linux 和 macOS 平台 34 | -------------------------------------------------------------------------------- /docs/cn/release.md: -------------------------------------------------------------------------------- 1 | # 发布记录 2 | 3 | ## Release v2.0.7 4 | 5 | - 网络传输重写,不会出现proxy写ui丢弃的情况 6 | - agent使用sqlite代替rocksdb存储 7 | - 支持jstack、dump等agent端文件[下载](./downloadFile.md) 8 | - 支持[性能分析](./profiler.md),一键定位程序问题 9 | - 支持[java11](./java11.md) 10 | -------------------------------------------------------------------------------- /docs/cn/store.md: -------------------------------------------------------------------------------- 1 | # bistoury存储方案 2 | bistory的动态监控数据、线程级cpu监控数据、jmap数据均需要在应用机器上保存三天,需要选择一款数据库来保存这些数据。 3 | 4 | bistoury之前的版本采用的是rocksdb进行存储,定时手动调用compact,但是rocksdb进行数据压缩时会使得磁盘IO及cpu飙高,rocksdb自身的压缩线程优先级太低,长时间使用会导致磁盘占用增高。 5 | 6 | 基于以上问题,bistoury将存储方案从rocksdb换为sqlite,SQLite是一个轻量级、跨平台的关系型数据库。既然号称关系型数据库,删除数据不会直接释放磁盘,下次写入时会复用已经删除的磁盘空间,保证磁盘占用不会无限增长 7 | 8 | ## 存储方案切换 9 | agent 启动时配置系统参数-Dbistoury.store.db=sqlite可将存储方案从rocksdb切为sqlite 10 | **注意:** 切换存储方案后,会将原来rocksDb存储的数据全部删除,导致最近三天的数据丢失 11 | 12 | -------------------------------------------------------------------------------- /docs/image/app_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/app_add.png -------------------------------------------------------------------------------- /docs/image/app_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/app_info.png -------------------------------------------------------------------------------- /docs/image/app_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/app_panel.png -------------------------------------------------------------------------------- /docs/image/app_server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/app_server.png -------------------------------------------------------------------------------- /docs/image/app_server_manger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/app_server_manger.png -------------------------------------------------------------------------------- /docs/image/bistoury_qq_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/bistoury_qq_small.png -------------------------------------------------------------------------------- /docs/image/cannot_lib_class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/cannot_lib_class.png -------------------------------------------------------------------------------- /docs/image/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/console.png -------------------------------------------------------------------------------- /docs/image/debug-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/debug-main.png -------------------------------------------------------------------------------- /docs/image/debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/debug.png -------------------------------------------------------------------------------- /docs/image/debug_class_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/debug_class_list.png -------------------------------------------------------------------------------- /docs/image/debug_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/debug_panel.png -------------------------------------------------------------------------------- /docs/image/design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/design.png -------------------------------------------------------------------------------- /docs/image/design/agent_connect_to_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/design/agent_connect_to_proxy.png -------------------------------------------------------------------------------- /docs/image/design/command_execute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/design/command_execute.png -------------------------------------------------------------------------------- /docs/image/design/ui_choose_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/design/ui_choose_proxy.png -------------------------------------------------------------------------------- /docs/image/deug_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/deug_panel.png -------------------------------------------------------------------------------- /docs/image/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/download.png -------------------------------------------------------------------------------- /docs/image/image-20210819175338181.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/image-20210819175338181.png -------------------------------------------------------------------------------- /docs/image/image-20210819175409442.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/image-20210819175409442.png -------------------------------------------------------------------------------- /docs/image/image-20210819175554861.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/image-20210819175554861.png -------------------------------------------------------------------------------- /docs/image/jmap_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jmap_panel.png -------------------------------------------------------------------------------- /docs/image/jstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack.png -------------------------------------------------------------------------------- /docs/image/jstack_cpu_thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack_cpu_thread.png -------------------------------------------------------------------------------- /docs/image/jstack_entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack_entry.png -------------------------------------------------------------------------------- /docs/image/jstack_jmap_switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack_jmap_switch.png -------------------------------------------------------------------------------- /docs/image/jstack_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack_panel.png -------------------------------------------------------------------------------- /docs/image/jstack_thread_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack_thread_search.png -------------------------------------------------------------------------------- /docs/image/jstack_thread_stacktrace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jstack_thread_stacktrace.png -------------------------------------------------------------------------------- /docs/image/jvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/jvm.png -------------------------------------------------------------------------------- /docs/image/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/monitor.png -------------------------------------------------------------------------------- /docs/image/monitor_class_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/monitor_class_list.png -------------------------------------------------------------------------------- /docs/image/monitor_display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/monitor_display.png -------------------------------------------------------------------------------- /docs/image/monitor_entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/monitor_entry.png -------------------------------------------------------------------------------- /docs/image/monitor_panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/monitor_panel.png -------------------------------------------------------------------------------- /docs/image/private_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/private_token.png -------------------------------------------------------------------------------- /docs/image/profiler_method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/profiler_method.png -------------------------------------------------------------------------------- /docs/image/profiler_stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/profiler_stack.png -------------------------------------------------------------------------------- /docs/image/profiler_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/profiler_start.png -------------------------------------------------------------------------------- /docs/image/profiler_start_step_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/profiler_start_step_2.png -------------------------------------------------------------------------------- /docs/image/thread_dump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/docs/image/thread_dump.png -------------------------------------------------------------------------------- /script/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "${0%/*}" 4 | cd .. 5 | 6 | PROFILR='prod' 7 | 8 | #打包agent 9 | echo "================ starting to build bistoury agent ================" 10 | ./mvnw clean package -am -pl bistoury-dist -P$PROFILR -Dmaven.test.skip -Denforcer.skip=true 11 | echo "================ building bistoury agent finished ================" 12 | 13 | #打包ui 14 | echo "================ starting to build bistoury ui ================" 15 | ./mvnw clean package -am -pl bistoury-ui -P$PROFILR -Dmaven.test.skip=true -Denforcer.skip=true 16 | echo "================ building bistoury ui finished ================" 17 | 18 | #打包proxy 19 | echo "================ starting to build bistoury proxy ================" 20 | ./mvnw clean package -am -pl bistoury-proxy -P$PROFILR -Dmaven.test.skip=true -Denforcer.skip=true 21 | echo "================ building bistoury proxy finished ================" -------------------------------------------------------------------------------- /script/debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "${0%/*}" 4 | cd .. 5 | 6 | PROFILR='prod' 7 | ./mvnw clean package install -am -pl bistoury-dist -P$PROFILR -Dmaven.test.skip -Denforcer.skip=true 8 | -------------------------------------------------------------------------------- /script/h2/data.sql: -------------------------------------------------------------------------------- 1 | insert into bistoury_user (user_code, password) values ('admin','q1mHvT20zskSnIHSF27d/A=='); 2 | insert into bistoury_app(code, name, group_code, status, creator) values ('bistoury_demo_app','测试应用','tcdev',1,'admin'); 3 | insert into bistoury_user_app (app_code, user_code) values ('bistoury_demo_app','admin'); 4 | insert into bistoury_server (server_id, ip, port, host, log_dir, room, app_code, auto_jstack_enable, auto_jmap_histo_enable) values ('bade8ba7d59b4ca0b91a044739a670aa','${local_ip}',8080,'${local_host}','${log_dir}','al','bistoury_demo_app',1,0); 5 | -------------------------------------------------------------------------------- /script/h2/h2-1.4.199.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xopencode/bistouryX/26e8d19fc0646ed6e6b48c5b1914b74ec5c253c0/script/h2/h2-1.4.199.jar --------------------------------------------------------------------------------