Home > Software engineering >  How to run clinic.js with autocannon POST command
How to run clinic.js with autocannon POST command

Time:01-24

When I try to run clinic with autocannon like this I have no issues:

clinic flame --on-port="autocannon localhost:7269/healthcheck" -- node ./dist/src/index.js

If I try to run clinic.js with autocannon POST method:

clinic flame --on-port='autocannon -t 30 -c 100 -m POST -H "Authorization":"Bearer .eyJpZC" -H "review-app-secret-key":"9013a568aaeaa" -H "ecosystem-profile-id":"eco17" -H "Content-Type: application/json" -b '{"operationName":"getEcosystemAdminSessionSummary","variables":{"input":{"pageNum":1,"limit":25,"sessionStatus":"UPCOMING","selectedFilters":[{"type":"num","values":["25"]}],"dateTimeSort":1}},"query":"query getEcosystemAdminSessionSummary($input: SessionSummaryV3Input!) {\n  getEcosystemAdminSessionSummary(input: $input) {\n    sessions {\n      id\n      subject\n      subjectId\n      sessionDescription\n      status\n      sessionType\n      participants(needsFeedbackInfo: true) {\n        user {\n          id\n          profile {\n            firstName\n            lastName\n            profileId\n            profilePicture {\n              src\n              __typename\n            }\n            phoneNumber\n            status\n            __typename\n          }\n          ... on PAASUser {\n            ecosystemProfile {\n              status\n              __typename\n            }\n            __typename\n          }\n          email {\n            address\n            __typename\n          }\n          __typename\n        }\n        userType\n        joinedTime\n        joinedTimeDelta\n        leftTime\n        sessionPayoutStatus\n        tutorBasePaymentAmount\n        remaining\n        hourlyRate\n        hasPendingFeedback\n        hasAssociatedFeedbackForm\n        feedbackSubmitDate\n        feedbackSubmitBy\n        feedbackEditedBy\n        participantFeedbackForm {\n          id\n          formType\n          __typename\n        }\n        description\n        __typename\n      }\n      numLeaders\n      numLearners\n      maxStudents\n      tutorReviews {\n        revieweeId\n        __typename\n      }\n      date\n      startTime\n      endTime\n      processingTime\n      cancellationPolicyTime\n      timeZoneId\n      recurringDays\n      recurringSessionId\n      weeksRecurring\n      weeksRepeat\n      recurringStartDate\n      recurringEndDate\n      tutoringAmount\n      meetingSolution\n      isInPerson\n      isPaid\n      ecosystemId\n      gradeLevel\n      gradeLevels\n      schools {\n        id\n        name\n        __typename\n      }\n      joinUrl\n      sessionCompletionStatus\n      zoomOptions {\n        tutorflyBookerId\n        meetingId\n        join_url\n        host_id\n        start_url\n        password\n        __typename\n      }\n      lessonspaceOptions {\n        roomId\n        __typename\n      }\n      uploadedFiles {\n        method\n        fileNames\n        __typename\n      }\n      physicalSessionOptions {\n        locationName\n        locationPoint {\n          type\n          coordinates\n          __typename\n        }\n        __typename\n      }\n      program {\n        id\n        name\n        shortName\n        sessions {\n          sessionJoinMinutesPrior\n          sessionRecordingsProfileTypes\n          __typename\n        }\n        subBoard {\n          enabled\n          visibleToTutors\n          __typename\n        }\n        __typename\n      }\n      subRequests {\n        id\n        userId\n        status\n        __typename\n      }\n      courseSection {\n        name\n        maxEnrollments\n        enrolledStudentsAmt\n        programs {\n          id\n          name\n          sessions {\n            sessionJoinMinutesPrior\n            sessionRecordingsProfileTypes\n            zoomEnabled\n            __typename\n          }\n          __typename\n        }\n        perUserRate\n        currentUserIsEnrolled\n        __typename\n      }\n      sessionFiles {\n        id\n        filename\n        url\n        creator\n        __typename\n      }\n      __typename\n    }\n    hasMore\n    totalSessionCount\n    __typename\n  }\n}\n"}' http://localhost:7269/api/graphql" -- node ./dist/src/index.js

I get an error: zsh: event not found: )

If I run autocannon with post method without autoclinic it works.

CodePudding user response:

It's possible to use autocannon -i parameter to avoid escaping issues. More info here

  • Related