Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log & Monitor
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

Tự tạo Command “php artisan” cho riêng mình trên web laravel

Posted on June 13, 2021December 28, 2021 By nim No Comments on Tự tạo Command “php artisan” cho riêng mình trên web laravel

Links list videos:

Các thứ chạy command laravel thì nằm hết trong func handler

$this->info() để in kêt quả ra ngoài màn hình.

câu lệnh tạo file command: php artisan make:command GetAllocationClusterDailyKubecost

Khai bao command sẽ gõ như thế nào

php artisan kubecost:getAllocationClusterDaily

Contents

  • 1) Option
  • 2) Print result.

1) Option

Để hứng được option {--days=} trong 1 function

Khi gõ command:

php artisan prometheus:pullAvailabilityMetrics --days=1
hoặc không có option cũng được:
php artisan prometheus:pullAvailabilityMetrics

https://viblo.asia/p/laravel-commands-5y8Rr6YbRob3

2) Print result.

$this->info($days);

echo sprintf("Process date %s, workload %s, duration %s, counter 5xx = %s, counter total = %s, error rate = %s, Max mem/cpu = %s/%s, Avg mem/cpu = %s/%s, Outage Duration = %s successfully",
            $date,
            $workloadName,
            $duration,
            $counter5xx,
            $counterTotal,
            (isset($errorRate) ? $errorRate : 'NULL'),
            $maxMemUsage,
            $maxCpuUsage,
            $avgMemUsage,
            $avgCpuUsage,
            $outageDuration,
        ) . PHP_EOL;
Laravel

Post navigation

Previous Post: Hướng dẫn delete branch git bằng command
Next Post: [error] Lỗi failed to parse field [host] of type [text] in document with id trên elk

More Related Articles

[Popup/Ajax] Tạo popup(modal/bootstrap) insert data bằng ajax và php Coding
Hướng dẫn thêm column(cột) và change type column cho table bằng command trong Laravel Laravel
[Laravel] Create file controller in Laravel. Laravel
[SlackAPI/Laravel] Laravel call API Slack. Laravel
[PHP] Hướng dẫn kiểm tra array rỗng hay null không? Laravel
Các Lệnh query với Model của Laravel eloquent Laravel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Prometheus/Grafana] Install Prometheus and Grafana on ubuntu. March 27, 2023
  • [Kong Gateway] WebSocket connection failed March 26, 2023
  • [Nextcloud] Can’t download files to have a size bigger than 2Gi on NextCloud – RaspBerry March 24, 2023
  • [Datadog] Using DataDog to monitor all services on kubernetes March 19, 2023
  • [Metrics Server] Failed to make webhook authorizer request: the server could not find the requested resource March 17, 2023

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • MetalLB
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.