<commit_before>// This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences
// and <NAME>
//
// 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.

#pragma once
#ifndef DASHBOARD_COMPONENTS_MEMMAP_HPP
#define DASHBOARD_COMPONENTS_MEMMAP_HPP

#include "../component.hpp"

#include <os>

namespace mana {
namespace dashboard {

class Memmap : public Component {

public:

  static std::shared_ptr<Memmap> instance() {
    static std::weak_ptr<Memmap> instance_;
    if(auto p = instance_.lock())
      return p;

    std::shared_ptr<Memmap> p{new Memmap};
    instance_ = p;
    return p;
  }

  std::string key() const override
  { return "memmap"; }

  void serialize(Writer& writer) override {
    writer.StartArray();
    for (auto&& i : OS::memory_map())
    {
      auto& entry = i.second;
      writer.StartObject();

      writer.Key("name");
      writer.String(entry.name());

      writer.Key("addr_start");
      writer.Uint(entry.addr_start());

      writer.Key("addr_end");
      writer.Uint(entry.addr_end());

      writer.Key("in_use");
      writer.Uint(entry.bytes_in_use());

      writer.Key("description");
      writer.String(entry.description());

      writer.EndObject();
    }
    writer.EndArray();
  }

private:
  Memmap() {}

};

} // < namespace dashboard
} // < namespace mana

#endif



<commit_msg>mana: Remove description from memmap entries<commit_after>// This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences
// and <NAME>
//
// 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.

#pragma once
#ifndef DASHBOARD_COMPONENTS_MEMMAP_HPP
#define DASHBOARD_COMPONENTS_MEMMAP_HPP

#include "../component.hpp"

#include <os>

namespace mana {
namespace dashboard {

class Memmap : public Component {

public:

  static std::shared_ptr<Memmap> instance() {
    static std::weak_ptr<Memmap> instance_;
    if(auto p = instance_.lock())
      return p;

    std::shared_ptr<Memmap> p{new Memmap};
    instance_ = p;
    return p;
  }

  std::string key() const override
  { return "memmap"; }

  void serialize(Writer& writer) override {
    writer.StartArray();
    for (auto&& i : OS::memory_map())
    {
      auto& entry = i.second;
      writer.StartObject();

      writer.Key("name");
      writer.String(entry.name());

      writer.Key("addr_start");
      writer.Uint(entry.addr_start());

      writer.Key("addr_end");
      writer.Uint(entry.addr_end());

      writer.Key("in_use");
      writer.Uint(entry.bytes_in_use());

      writer.EndObject();
    }
    writer.EndArray();
  }

private:
  Memmap() {}

};

} // < namespace dashboard
} // < namespace mana

#endif
{'fraction_non_alphanumeric': 0.12266385891023954, 'fraction_numerical': 0.006317451961042379, 'mean_word_length': 3.2222222222222223, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4263694', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1116, 'n_words': 355}