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


Java ProfilerEvent.TYPE_OBJECT_CREATION属性代码示例

本文整理汇总了Java中com.mysql.jdbc.profiler.ProfilerEvent.TYPE_OBJECT_CREATION属性的典型用法代码示例。如果您正苦于以下问题:Java ProfilerEvent.TYPE_OBJECT_CREATION属性的具体用法?Java ProfilerEvent.TYPE_OBJECT_CREATION怎么用?Java ProfilerEvent.TYPE_OBJECT_CREATION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.mysql.jdbc.profiler.ProfilerEvent的用法示例。


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

示例1: expandProfilerEventIfNecessary

public static Object expandProfilerEventIfNecessary(Object possibleProfilerEvent) {

        if (possibleProfilerEvent instanceof ProfilerEvent) {
            StringBuilder msgBuf = new StringBuilder();

            ProfilerEvent evt = (ProfilerEvent) possibleProfilerEvent;

            String locationInformation = evt.getEventCreationPointAsString();

            if (locationInformation == null) {
                locationInformation = Util.stackTraceToString(new Throwable());
            }

            msgBuf.append("Profiler Event: [");

            switch (evt.getEventType()) {
                case ProfilerEvent.TYPE_EXECUTE:
                    msgBuf.append("EXECUTE");

                    break;

                case ProfilerEvent.TYPE_FETCH:
                    msgBuf.append("FETCH");

                    break;

                case ProfilerEvent.TYPE_OBJECT_CREATION:
                    msgBuf.append("CONSTRUCT");

                    break;

                case ProfilerEvent.TYPE_PREPARE:
                    msgBuf.append("PREPARE");

                    break;

                case ProfilerEvent.TYPE_QUERY:
                    msgBuf.append("QUERY");

                    break;

                case ProfilerEvent.TYPE_WARN:
                    msgBuf.append("WARN");

                    break;

                case ProfilerEvent.TYPE_SLOW_QUERY:
                    msgBuf.append("SLOW QUERY");

                    break;

                default:
                    msgBuf.append("UNKNOWN");
            }

            msgBuf.append("] ");
            msgBuf.append(locationInformation);
            msgBuf.append(" duration: ");
            msgBuf.append(evt.getEventDuration());
            msgBuf.append(" ");
            msgBuf.append(evt.getDurationUnits());
            msgBuf.append(", connection-id: ");
            msgBuf.append(evt.getConnectionId());
            msgBuf.append(", statement-id: ");
            msgBuf.append(evt.getStatementId());
            msgBuf.append(", resultset-id: ");
            msgBuf.append(evt.getResultSetId());

            String evtMessage = evt.getMessage();

            if (evtMessage != null) {
                msgBuf.append(", message: ");
                msgBuf.append(evtMessage);
            }

            return msgBuf;
        }

        return possibleProfilerEvent;
    }
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:80,代码来源:LogUtils.java

示例2: expandProfilerEventIfNecessary

public static Object expandProfilerEventIfNecessary(
		Object possibleProfilerEvent) {

	if (possibleProfilerEvent instanceof ProfilerEvent) {
		StringBuffer msgBuf = new StringBuffer();

		ProfilerEvent evt = (ProfilerEvent) possibleProfilerEvent;

		String locationInformation = evt.getEventCreationPointAsString();

		if (locationInformation == null) {
			locationInformation = Util.stackTraceToString(new Throwable());
		}

		msgBuf.append("Profiler Event: [");

		switch (evt.getEventType()) {
		case ProfilerEvent.TYPE_EXECUTE:
			msgBuf.append("EXECUTE");

			break;

		case ProfilerEvent.TYPE_FETCH:
			msgBuf.append("FETCH");

			break;

		case ProfilerEvent.TYPE_OBJECT_CREATION:
			msgBuf.append("CONSTRUCT");

			break;

		case ProfilerEvent.TYPE_PREPARE:
			msgBuf.append("PREPARE");

			break;

		case ProfilerEvent.TYPE_QUERY:
			msgBuf.append("QUERY");

			break;

		case ProfilerEvent.TYPE_WARN:
			msgBuf.append("WARN");

			break;
			
		case ProfilerEvent.TYPE_SLOW_QUERY:
			msgBuf.append("SLOW QUERY");

			break;
			
		default:
			msgBuf.append("UNKNOWN");
		}

		msgBuf.append("] ");
		msgBuf.append(locationInformation);
		msgBuf.append(" duration: ");
		msgBuf.append(evt.getEventDuration());
		msgBuf.append(" ");
		msgBuf.append(evt.getDurationUnits());
		msgBuf.append(", connection-id: ");
		msgBuf.append(evt.getConnectionId());
		msgBuf.append(", statement-id: ");
		msgBuf.append(evt.getStatementId());
		msgBuf.append(", resultset-id: ");
		msgBuf.append(evt.getResultSetId());

		String evtMessage = evt.getMessage();

		if (evtMessage != null) {
			msgBuf.append(", message: ");
			msgBuf.append(evtMessage);
		}

		return msgBuf;
	}
	
	return possibleProfilerEvent;
}
 
开发者ID:hinsenchan,项目名称:fil_project_mgmt_app_v2,代码行数:81,代码来源:LogUtils.java

示例3: expandProfilerEventIfNecessary

public static Object expandProfilerEventIfNecessary(Object possibleProfilerEvent) {

        if (possibleProfilerEvent instanceof ProfilerEvent) {
            StringBuffer msgBuf = new StringBuffer();

            ProfilerEvent evt = (ProfilerEvent) possibleProfilerEvent;

            String locationInformation = evt.getEventCreationPointAsString();

            if (locationInformation == null) {
                locationInformation = Util.stackTraceToString(new Throwable());
            }

            msgBuf.append("Profiler Event: [");

            switch (evt.getEventType()) {
                case ProfilerEvent.TYPE_EXECUTE:
                    msgBuf.append("EXECUTE");

                    break;

                case ProfilerEvent.TYPE_FETCH:
                    msgBuf.append("FETCH");

                    break;

                case ProfilerEvent.TYPE_OBJECT_CREATION:
                    msgBuf.append("CONSTRUCT");

                    break;

                case ProfilerEvent.TYPE_PREPARE:
                    msgBuf.append("PREPARE");

                    break;

                case ProfilerEvent.TYPE_QUERY:
                    msgBuf.append("QUERY");

                    break;

                case ProfilerEvent.TYPE_WARN:
                    msgBuf.append("WARN");

                    break;

                case ProfilerEvent.TYPE_SLOW_QUERY:
                    msgBuf.append("SLOW QUERY");

                    break;

                default:
                    msgBuf.append("UNKNOWN");
            }

            msgBuf.append("] ");
            msgBuf.append(locationInformation);
            msgBuf.append(" duration: ");
            msgBuf.append(evt.getEventDuration());
            msgBuf.append(" ");
            msgBuf.append(evt.getDurationUnits());
            msgBuf.append(", connection-id: ");
            msgBuf.append(evt.getConnectionId());
            msgBuf.append(", statement-id: ");
            msgBuf.append(evt.getStatementId());
            msgBuf.append(", resultset-id: ");
            msgBuf.append(evt.getResultSetId());

            String evtMessage = evt.getMessage();

            if (evtMessage != null) {
                msgBuf.append(", message: ");
                msgBuf.append(evtMessage);
            }

            return msgBuf;
        }

        return possibleProfilerEvent;
    }
 
开发者ID:BasThomas,项目名称:SMPT42,代码行数:80,代码来源:LogUtils.java


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