package com.bytedance.apm.agent.monitor;

import X.0HH;
import X.2p5;
import X.AnonymousClass9M2;
import X.AnonymousClass9MO;
import X.C41449Ah;
import X.C44279Le;
import X.C45069Of;
import com.bytedance.covode.number.Covode;
import org.json.JSONObject;

public class MonitorTool {
    static {
        Covode.recordClassIndex(23085);
    }

    public static void monitorUIAction(final String str, final String str2, final JSONObject jSONObject) {
        2p5.LIZ.LIZ((Runnable) new Runnable() {
            static {
                Covode.recordClassIndex(23086);
            }

            public final void run() {
                C45069Of.LIZIZ().LIZ(new AnonymousClass9M2(str, str2, jSONObject));
            }
        });
    }

    public static void reportTraceTime(final String str, final String str2, final long j) {
        2p5.LIZ.LIZ((Runnable) new Runnable() {
            static {
                Covode.recordClassIndex(23090);
            }

            public final void run() {
                try {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put(str2, j);
                    JSONObject jSONObject2 = new JSONObject();
                    jSONObject2.put("scene", str);
                    C45069Of.LIZIZ().LIZ(new AnonymousClass9MO("page_load", "page_load", jSONObject, jSONObject2, (JSONObject) null, (byte) 0));
                } catch (Exception unused) {
                }
            }
        });
    }

    public static void monitorStart(String str, long j, long j2) {
        if (j2 > j) {
            try {
                final JSONObject jSONObject = new JSONObject();
                jSONObject.put(str, j2 - j);
                final JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("begin_time", j);
                jSONObject2.put("end_time", j2);
                2p5.LIZ.LIZ((Runnable) new Runnable() {
                    static {
                        Covode.recordClassIndex(23089);
                    }

                    public final void run() {
                        C45069Of.LIZIZ().LIZ(new AnonymousClass9MO("start", "", jSONObject, (JSONObject) null, jSONObject2, (byte) 0));
                    }
                });
            } catch (Exception e) {
                0HH.LIZ(e);
            }
        }
    }

    public static void monitorStart(final JSONObject jSONObject, long j, long j2) {
        try {
            final JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("begin_time", j);
            jSONObject2.put("end_time", j2);
            jSONObject2.put("from", "monitor-plugin");
            2p5.LIZ.LIZ((Runnable) new Runnable() {
                static {
                    Covode.recordClassIndex(23088);
                }

                public final void run() {
                    C45069Of.LIZIZ().LIZ(new AnonymousClass9MO("start", "", jSONObject, (JSONObject) null, jSONObject2, (byte) 0));
                }
            });
        } catch (Exception e) {
            0HH.LIZ(e);
        }
    }

    public static void monitorPerformance(final String str, final JSONObject jSONObject, final JSONObject jSONObject2, final JSONObject jSONObject3) {
        2p5.LIZ.LIZ((Runnable) new Runnable() {
            static {
                Covode.recordClassIndex(23087);
            }

            public final void run() {
                C45069Of.LIZIZ().LIZ(new AnonymousClass9MO(str, "", jSONObject, jSONObject2, jSONObject3, (byte) 0));
            }
        });
    }

    public static void monitorSLA(final long j, final long j2, final String str, final String str2, final String str3, final int i, final JSONObject jSONObject) {
        2p5.LIZ.LIZ((Runnable) new Runnable() {
            static {
                Covode.recordClassIndex(23091);
            }

            public final void run() {
                C41449Ah.LIZ.LIZ(new C44279Le("api_all", j, j2, str, str2, str3, i, jSONObject));
            }
        });
    }
}
