// This is an automatically generated code sample. 
// To make this code sample work in your Oracle Cloud tenancy, 
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and 
// boolean, number, and enum parameters with values not fitting your use case).

import * as opsi from "oci-opsi";
import common = require("oci-common");

// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
    try {
     // Create a service client
     const client = new opsi.OperationsInsightsClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  ingestMySqlSqlStatsDetails = {
		items: [{
				digest: "EXAMPLE-digest-Value",
				timeCollected: new Date("Tue Nov 02 20:10:40 UTC 2027"),
				commandType: "EXAMPLE-commandType-Value",
				totalRows: 786,
				perfSchemaUsedPercent: 237,
				schemaName: "EXAMPLE-schemaName-Value",
				execCount: 835,
				totalLatencyInPs: 605,
				lockLatencyInPs: 822,
				errCount: 190,
				warnCount: 496,
				rowsAffected: 121,
				rowsSent: 422,
				rowsExamined: 423,
				tmpDiskTables: 536,
				tmpTables: 605,
				selectFullJoin: 305,
				selectFullRangeJoin: 748,
				selectRange: 646,
				selectRangeCheck: 701,
				selectScan: 453,
				sortMergePasses: 155,
				sortRange: 720,
				rowsSorted: 645,
				sortScan: 773,
				noIndexUsedCount: 805,
				noGoodIndexUsedCount: 486,
				cpuLatencyInPs: 541,
				maxControlledMemoryInBytes: 204,
				maxTotalMemoryInBytes: 152,
				execCountSecondary: 365,
				timeFirstSeen: new Date("Wed Jun 07 09:56:10 UTC 2006"),
				timeLastSeen: new Date("Fri Sep 18 08:29:31 UTC 2043"),

				}
				],

		}

	const ingestMySqlSqlStatsRequest: opsi.requests.IngestMySqlSqlStatsRequest = { 
	ingestMySqlSqlStatsDetails: ingestMySqlSqlStatsDetails,
	databaseId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
	id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
	opcRequestId: "83S9AKEMQP9S62WHLPVQ<unique_ID>",
	ifMatch: "EXAMPLE-ifMatch-Value",
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",

		}; 


     // Send request to the Client.
     const ingestMySqlSqlStatsResponse = await client.ingestMySqlSqlStats(ingestMySqlSqlStatsRequest);
     }
     catch (error) {
         console.log("ingestMySqlSqlStats Failed with error  " + error);
     }
})();