/******************************************************************************* * ============LICENSE_START======================================================= * org.onap.dmaap * ================================================================================ * Copyright © 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= * * ECOMP is a trademark and service mark of AT&T Intellectual Property. * *******************************************************************************/ #include #include #include #include "cambria.h" const char* kAlarm = "" "12.123.70.213" "ptdor306me1.els-an.att.net" "1364716208" " V1" " 9" " .1.3.6.1.4.1.9.9.187" " 6" " 2" " 167" " 0" " 0" " 0" " 1554393204" " 10" " nidVeskaf0" " " " .1.3.6.1.2.1.15.3.1.14.32.4.52.58" " OCTET_STRING_HEX" " 02 02 " " " " " " .1.3.6.1.2.1.15.3.1.2.32.4.52.58" " INTEGER" " 1" " " " " " .1.3.6.1.4.1.9.9.187.1.2.1.1.7.32.4.52.58" " OCTET_STRING_ASCII" " peer in wrong AS" " " " " " .1.3.6.1.4.1.9.9.187.1.2.1.1.8.32.4.52.58" " INTEGER" " 4" " " ""; int main ( int argc, const char* argv[] ) { char** msgs = new char* [ 100 ]; for ( int i=0; i<100; i++ ) { msgs[i] = new char [ ::strlen ( kAlarm + 1 ) ]; ::strcpy ( msgs[i], kAlarm ); } std::time_t start = std::time ( NULL ); for ( int i=0; i<5000; i++ ) { ::cambriaSimpleSendMultiple ( "localhost", 8080, "topic", "streamName", (const char**)msgs, 100 ); if ( i % 50 == 0 ) { std::time_t end = std::time ( NULL ); double seconds = difftime ( end, start ); ::printf ( "%.f seconds for %u posts.\n", seconds, i*100 ); } } std::time_t end = std::time ( NULL ); double seconds = difftime ( end, start ); ::printf ( "%.f seconds for 1,000,000 posts.\n", seconds ); return 0; }